jQuery in Action

28
CHAPTER 2
Creating the wrapped element set
input:checked
narrows the search to only
<input>
elements that are checked.
The custom
:checked
selector works like a
CSS
attribute selector (such as
[foo=bar]
) in that both filter the matching set of elements by some criteria. Com-
bining these custom selectors can be powerful; consider
:radio:checked
and
:checkbox:checked
.
As we discussed earlier, jQuery supports all of the
CSS
filter selectors and also
a number of custom selectors defined by jQuery. They are described in table 2.3.
Table 2.3 The jQuery custom filter selectors that give immense power to identify
target elements
Selector
Description
:animated
Selects elements that are currently under animated control. Chapter 5 will cover
animations and effects.
:button
Selects any button (input[type=submit], input[type=reset],
input[type=button]
, or button).
:checkbox
Selects only check box elements (input[type=checkbox]).
:checked
Selects only check boxes or radio buttons that are checked (supported by CSS).
:contains(foo)
Selects only elements containing the text foo.
:disabled
Selects only form elements that are disabled in the interface (supported by CSS).
:enabled
Selects only form elements that are enabled in the interface (supported by CSS).
:file
Selects all file elements (input[type=file]).
:header
Selects only elements that are headers; for example: <h1> through
<h6>
elements.
:hidden
Selects only elements that are hidden.
:image
Selects form images (input[type=image]).
:input
Selects only form elements (input, select, textarea, button).
:not(filter)
Negates the specified filter.
:parent
Selects only elements that have children (including text), but not empty elements.
:password
Selects only password elements (input[type=password]).
:radio
Selects only radio elements (input[type=radio]).
:reset
Selects reset buttons (input[type=reset] or button[type=reset]).
continued on next page


Другие страницы

 
Cкачать книги бесплатно без регистрации в электронном виде (pdf, chm, txt).Вы можете читать книги онлайн на нашем сайте литературного портала книг.Большая подборка учебников, пособий, интересных книг.Электронные книги на английском языке скачать бесплатно без смс.