jquery Selection Filter |
Filter filters |
Meaning |
#id |
Match the id attribute to an element of ID. In a valid}itml document, more than one element will never appear with the same ID, so the filter is typically used as a standalone selector |
. class |
Matches the class attribute (a list of words parsed into spaces) containing all the elements of a class word |
[attr] |
Match all elements that have the attr attribute (and value independent) |
[Attr=val] |
Match all elements that have the attr attribute and a value of Val |
[Attr!=val] |
Matches all elements that do not have the attr attribute, or the value of the Attr property is not Val (extension of jquery) |
[Attr^=val] |
element that matches the attr attribute value starting with Val |
[Attr$=val] |
Elements that match the value of the Attr property to Val-end |
[Attr*=val] |
Match attr attribute value contains Val element |
[Attr~=val] |
Matches the element that contains the word Val when its Attr property is interpreted as a space-delimited list of words. So the selector "Div.note" is the same as "div [Class~=note]" |
[Attr|=val] |
Match attr attribute value begins with Val and no other characters are followed, or other characters are elements that begin with a hyphen |
: Animated |
Matches the element in the animation that was created by jquery |
: button |
Match <button type= "button" > and <input type= "button" > element (Extension of jquery) |
: checkbox |
Match <input type= "checkbox" > Element (Extension of jquery), which is more efficient when explicitly prefixed with the input tag "Input:checkbox" |
: Checked |
Match the selected INPUT element |
: Contains (text) |
Matches the element that contains the text of the specified text (the extension of jquery). The parentheses in the filter determine the range of the text-without adding quotation marks. The text of the filtered element is determined by the textcontent or innertext attribute-This is the original document text, without tags and annotations |
:d isabled |
Match a disabled element |
: Empty |
Match elements with no child nodes, no text content |
: Enabled |
Match elements that are not disabled |
: EQ (N) |
Matches the nth element in the selected list based on the document order, starting at 0 (extension of jquery) |
: Even |
The element that matches even numbers in the list. Since the ordinal of the first element is 0, the 1th, 3rd, 5th, and so on are actually selected (extension of jquery) |
: File |
Match <input type= "file" > element (Extension of jquery) |
: First |
Matches the first element in a list. Same as ": eq (0)" (Extension of jquery) |
: First-child |
The matching element is the first child element of its parent node. Note: This differs from ": First" |
: GT (N) |
Matches an element with an ordinal greater than N in the selected list based on the document order, starting at 0 (extension of jquery) |
: Has (SEL) |
Matched elements have descendant elements that match the sel of the inline selector |
: Header |
Match all head elements: |
: Hidden |
Match all elements that are not visible on the screen: the offsetwidth and offsetheight of these elements are generally considered to be 0 |
: Image |
Match <input type= "image" > element. Note that the filter does not match the element (extension of jquery) |
: input |
Match user input elements: <input>, <textarea>, <select> and <button> (jquery extensions) |
: Last |
Matches the last element in the selected list (extension of jquery) |
: Last-child |
The matching element is the last child element of its parent node. Note: This differs from ": Last" |
: LT (N) |
Matches an element with an ordinal less than n in the selected list based on the document order, starting at 0 (extension of jquery) |
: Not (SEL) |
Matching element does not match inline selector sel |
: Nth (N) |
Same as ": EQ (n)" (Extension of jquery) |
: Nth-child (N) |
The matching element is the nth child element of its parent node: Can be numeric, word even, word odd, or calculation formula. Use ": Nth-child (even)" to select elements that are ranked 2nd or 4th in the child elements of their parent node. Use ": Nth-child (Odd)" To select elements that are 1th, 3rd, and so on in the child elements of their parent node. More commonly, n is a xn or x n+y formula, where x and y are integers and n is literal N. Therefore, you can use Nth-child (3n+1) to select the 1th, 4th, 7th and other elements. Note that the number of the filter starts at 1, so if an element is the first child of its parent, it is considered an odd element, matching 3n+1 instead of 3n. To be distinguished from ": Even and": odd "filters, which match the sequence number starting with 0. |
: Odd |
The element that matches the odd (starting 0) ordinal of the list. Note that the elements with ordinal 1 and 3 are the 2nd and 4th matching elements (the extension of jquery) |
: Only-child |
Matches elements that are unique child nodes of their parent node |
:p arent |
The match is the element of the parent node, which is the opposite of ": empty" (the extension of jquery) |
:p Assword |
Match <input type= "password" > elements (Extension of jquery) |
: Radio |
Match <input type= "Radio" > Element (Extension of J query) |
: RESET |
Match <input type= "reset" > and <button type= "reset" > elements (jquery extensions) |
: Selected |
Matches the selected <option> element. Use ": Checked" to select selected check boxes and radio boxes (jquery extensions) |
: Submit |
Match <input type= "Submit" > and <button type= "Submit" > elements (Extension of jquery) |
: Text |
Match <input type= "text" > elements (Extension of jquery) |
: Visible |
Matches all currently visible elements: the offsetwidth and offsetheight values of these elements are generally considered to be not 0, which is the opposite of ": hidden" |