Home > Web Front-end > JS Tutorial > jQuery: Detailed explanation of the use of input selector

jQuery: Detailed explanation of the use of input selector

黄舟
Release: 2017-06-23 15:19:47
Original
1267 people have browsed it

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>
Copy after login

jQuery Code:

$(":input")
Copy after login
Copy after login

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>, ]
Copy after login

This selector matches all input element. For example: etc.

Grammar structure:

$(":input")
Copy after login
Copy after login

Example code:






:input选择器-脚本之家
 
 
 
 
  • 读书
Copy after login

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!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template