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: 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!