API/1.3/Selectors
From jQuery JavaScript Library
(Redirected from )
Jump to: ,
Basics:Name | Type |
---|
| Returns: <> |
Matches a single element with the given id attribute. |
| Returns: <(s)> |
Matches all elements with the given name. |
| Returns: <(s)> |
Matches all elements with the given class. |
| Returns: <(s)> |
Matches all elements. |
| Returns: <(s)> |
Matches the combined results of all the specified selectors. |
Hierarchy:Name | Type |
---|
| Returns: <(s)> |
Matches all descendant elements specified by "descendant" of elements specified by "ancestor". |
| Returns: <(s)> |
Matches all child elements specified by "child" of elements specified by "parent". |
| Returns: <(s)> |
Matches all next elements specified by "next" that are next to elements specified by "prev". |
| Returns: <(s)> |
Matches all sibling elements after the "prev" element that match the filtering "siblings" selector. |
Basic Filters:Name | Type |
---|
| Returns: <> |
Matches the first selected element. |
| Returns: <> |
Matches the last selected element. |
| Returns: <(s)> |
Filters out all elements matching the given selector. |
| Returns: <(s)> |
Matches even elements, zero-indexed. |
| Returns: <(s)> |
Matches odd elements, zero-indexed. |
| Returns: <> |
Matches a single element by its index. |
| Returns: <(s)> |
Matches all elements with an index above the given one. |
| Returns: <(s)> |
Matches all elements with an index below the given one. |
| Returns: <(s)> |
Matches all elements that are headers, like h1, h2, h3 and so on. |
| Returns: <(s)> |
Matches all elements that are currently being animated. |
Content Filters:Name | Type |
---|
| Returns: <(s)> |
Matches elements which contain the given text. |
| Returns: <(s)> |
Matches all elements that have no children (including text nodes). |
| Returns: <(s)> |
Matches elements which contain at least one element that matches the specified selector. |
| Returns: <(s)> |
Matches all elements that are parents - they have child elements, including text. |
Visibility Filters:Name | Type |
---|
| Returns: <(s)> |
Matches all elements that are hidden. |
| Returns: <(s)> |
Matches all elements that are visible. |
Attribute Filters:Note:
In jQuery 1.3 [@attr] style selectors were removed (they were
previously deprecated in jQuery 1.2). Simply remove the '@' symbol from
your selectors in order to make them work again.
Name | Type |
---|
| Returns: <(s)> |
Matches elements that have the specified attribute. Note the "@" before the attribute name was deprecated as of version 1.2. |
| Returns: <(s)> |
Matches elements that have the specified attribute with a certain value. |
| Returns: <(s)> |
Matches elements that either don't have the specified attribute or do have the specified attribute but not with a certain value. |
| Returns: <(s)> |
Matches elements that have the specified attribute and it starts with a certain value. |
| Returns: <(s)> |
Matches elements that have the specified attribute and it ends with a certain value. |
| Returns: <(s)> |
Matches elements that have the specified attribute and it contains a certain value. |
| Returns: <(s)> |
Matches elements that match all of the specified attribute filters. |
Child Filters:Name | Type |
---|
| Returns: <(s)> |
Matches all elements that are the nth-child of their parent or that are the parent's even or odd children. |
| Returns: <(s)> |
Matches all elements that are the first child of their parent. |
| Returns: <(s)> |
Matches all elements that are the last child of their parent. |
| Returns: <(s)> |
Matches all elements that are the only child of their parent. |
Forms:Name | Type |
---|
| Returns: <(s)> |
Matches all input, textarea, select and button elements. |
| Returns: <(s)> |
Matches all input elements of type text. |
| Returns: <(s)> |
Matches all input elements of type password. |
| Returns: <(s)> |
Matches all input elements of type radio. |
| Returns: <(s)> |
Matches all input elements of type checkbox. |
| Returns: <(s)> |
Matches all input elements of type submit. |
:image | Returns: <(s)> |
Matches all input elements of type image. |
| Returns: <(s)> |
Matches all input elements of type reset. |
| Returns: <(s)> |
Matches all button elements and input elements of type button. |
| Returns: <(s)> |
Matches all input elements of type file. |
| Returns: <(s)> |
Matches all elements that are hidden. |
Form Filters:Name | Type |
---|
| Returns: <(s)> |
Matches all elements that are enabled. |
| Returns: <(s)> |
Matches all elements that are disabled. |
| Returns: <(s)> |
Matches all elements that are checked. |
| Returns: <(s)> |
Matches all elements that are selected. |
Note: if you wish to use any of the meta-characters described
above as a literal part of a name, you must escape the character with
two backslashes (\). Quotes are optional in most cases, but should be
used to avoid conflicts when the value contains characters like "]".
For example:
#foo\\:bar
#foo\\[bar\\]
#foo\\.bar
阅读(621) | 评论(0) | 转发(0) |