Home >Web Front-end >Layui Tutorial >How to get the value of input box in layui list

How to get the value of input box in layui list

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-07-11 15:26:4622383browse

We first create an input, the style name is layui-input. Then the key is to add an id value to it.

How to get the value of input box in layui list

Then add a button with an onclick event to trigger getting the value.

How to get the value of input box in layui list

In the script code, define a function that is triggered when the button is clicked.

We can use document.getElementById to get the input box, and the parameter is the id value of the input box.

How to get the value of input box in layui list

#After the input box is obtained, you can use its value attribute to get the value of the input box. Code: input.value

How to get the value of input box in layui list

Related recommendations: "layui framework tutorial"

Then use a simple alert method to pop up and get the value.

How to get the value of input box in layui list

Open the page and you can see the input boxes and buttons.

How to get the value of input box in layui list

Enter the value in the input box and click the button below.

How to get the value of input box in layui list

#After clicking, we can see that the value of this input box has been successfully obtained.

How to get the value of input box in layui list

The above is the detailed content of How to get the value of input box in layui list. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn