Home >Web Front-end >JS Tutorial >jQuery: Detailed explanation of the use of input selector
Overview
Match all input, textarea, select and button elements
Example
Description:
Find all input elements, the following elements will be matched.
HTML Code:
<form> <input type="button" value="Input Button"/> <input type="checkbox" /> <input type="file" /> <input type="hidden" /> <input type="image" /> <input type="password" /> <input type="radio" /> <input type="reset" /> <input type="submit" /> <input type="text" /> <select> <option>Option</option> </select> <textarea> </textarea> <button>Button</button> </form>
jQuery Code:
$(":input")
Result:
[ <input type="button" value="Input Button"/>, <input type="checkbox" />, <input type="file" />, <input type="hidden" />, <input type="image" />, <input type="password" />, <input type="radio" />, <input type="reset" />, <input type="submit" />, <input type="text" />, <select> <option>Option</option> </select>, <textarea> </textarea>, <button>Button</button>, ]
This selector matches all input element. For example: 22e1bb649e3e439c82b64204a5f95e3f etc.
Grammar structure:
$(":input")
Example code:
:input选择器-脚本之家
For the above code, click the button# After ##, the input element can be hidden.
The above is the detailed content of jQuery: Detailed explanation of the use of input selector. For more information, please follow other related articles on the PHP Chinese website!