Home > Web Front-end > JS Tutorial > jQuery form field attribute filter usage analysis_jquery

jQuery form field attribute filter usage analysis_jquery

WBOY
Release: 2016-05-16 16:14:45
Original
1120 people have browsed it

The example in this article describes the usage of jQuery form field attribute filter. Share it with everyone for your reference. The specific analysis is as follows:

The form contains a variety of form fields. You can use the form field attribute selector to get the selected radio buttons, check boxes and list items. You can also find the form from the document based on whether it is available. domain.

1. :checked selector

Used to select all selected form fields. Format:

Copy code The code is as follows:
$("selector:checked")
can be input, radio and checkbox

2. :enabled selector

is used to select all available form fields, format:

Copy code The code is as follows:
$("selector :enabled")

3. :disabled selector

is used to select all disabled form fields, format:

Copy code The code is as follows:
$(" selector:disabled")

4. :selected selector

is used to select all selected option elements from the list box, format:

Copy code The code is as follows:
$ ("selector:selected")

5. :hidden selector

Used to select all invisible elements

Copy code The code is as follows:
$("selector:hidden")

6. :visible selector

Used to select all visible elements

Simple example:

Copy code The code is as follows:




Form field attribute filter selector application example




Application example of form field attribute filter selector



















Checkbox: The selected checkbox
The checked checkbox
No checkbox selected
Available text boxes:
Unavailable text box:
Drop-down list



Rendering:

I hope this article will be helpful to everyone’s jQuery programming.

Related labels:
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