Category | Object | Returns | Example | Description |
---|---|---|---|---|
Basics | #id | Array<Element> | jQuery('#id') | Selects a single element with the given id attribute. |
Basics | element | Array<Element(s)> | jQuery('element') | Selects all elements with the given tag name. |
Basics | .class | Array<Element(s)> | jQuery('.class') | Selects all elements with the given class. |
Basics | * | Array<Element(s)> | jQuery('*') | Selects all elements.. Caution: The all, or universal, selector is extremely slow, except when used by itself. |
Basics | selector1, selector2, selectorN | Array<Element(s)> | jQuery('selector1, selector2, selectorN') | Selects the combined results of all the specified selectors. |
Basic Filters | :first | Element | jQuery(':first') | Selects the first matched element. |
Basic Filters | :last | Element | jQuery(':last') | Selects the last matched element. |
Basic Filters | :not(selector) | Array<Element(s)> | jQuery(':not(selector)') | Selects all elements that do not match the given selector. |
Basic Filters | :even | Array<Element(s)> | jQuery(':even') | Selects even elements, zero-indexed. |
Basic Filters | :odd | Array<Element(s)> | jQuery(':odd') | Selects odd elements, zero-indexed. |
Basic Filters | :eq(index) | Element | jQuery(':eq(index)') | Select the element at index n within the matched set. |
Basic Filters | :gt(index) | Array<Element(s)> | jQuery(':gt(index)') | Select all elements at an index greater than index within the matched set. |
Basic Filters | :lt(index) | Array<Element(s)> | jQuery(':lt(index)') | Select all elements at an index less than index within the matched set. |
Basic Filters | :header | Array<Element(s)> | jQuery(':header') | Selects all elements that are headers, like h1, h2, h3 and so on. |
Basic Filters | :animated | Array<Element(s)> | jQuery(':animated') | Select all elements that are in the progress of an animation at the time the selector is run. |
Hierarchy | ancestor descendant | Array<Element(s)> | jQuery('ancestor descendant') | Selects all elements that are 'descendant' of a given 'ancestor'. |
Hierarchy | parent > child | Array<Element(s)> | jQuery('parent > child') | Selects all direct child elements specified by 'child' of elements specified by 'parent'. |
Hierarchy | prev + next | Array<Element(s)> | jQuery('prev + next') | Selects all next elements matching 'next' that are immediately preceded by a sibling 'prev' |
Hierarchy | prev ~ siblings | Array<Element(s)> | jQuery('prev ~ siblings') | Selects all sibling elements that follow after the 'prev' element, have the same parent, and match the filtering 'siblings' selector. |
Content Filters | :contains(text) | Array<Element(s)> | jQuery(':contains(text)') | Select all elements that contain the specified text. |
Content Filters | :empty | Array<Element(s)> | jQuery(':empty') | Select all elements that have no children (including text nodes). |
Content Filters | :has(selector) | Array<Element(s)> | jQuery(':has(selector)') | Selects elements which contain at least one element that matches the specified selector. |
Content Filters | :parent | Array<Element(s)> | jQuery(':parent') | Select all elements that are the parent of another element, including text nodes. |
Visibility Filters | :hidden | Array<Element(s)> | jQuery(':hidden') | Selects all elements that are hidden. |
Visibility Filters | :visible | Array<Element(s)> | jQuery(':visible') | Selects all elements that are visible. |
Attribute | [attribute|=value] | Array<Element(s)> | jQuery('[attribute| | =value]') |
Attribute | [attribute*=value] | Array<Element(s)> | jQuery('[attribute*=value]') | Selects elements that have the specified attribute with a value containing the a given substring. |
Attribute | [attribute~=value] | Array<Element(s)> | jQuery('[attribute~=value]') | Selects elements that have the specified attribute with a value containing a given word, delimited by spaces. |
Attribute | [attribute$=value] | Array<Element(s)> | jQuery('[attribute$=value]') | Selects elements that have the specified attribute with a value ending exactly with a given string. |
Attribute | [attribute=value] | Array<Element(s)> | jQuery('[attribute=value]') | Selects elements that have the specified attribute with a value exactly equal to a certain value. |
Attribute | [attribute!=value] | Array<Element(s)> | jQuery('[attribute!=value]') | Select elements that either don't have the specified attribute, or do have the specified attribute but not with a certain value. |
Attribute | [attribute^=value] | Array<Element(s)> | jQuery('[attribute^=value]') | Selects elements that have the specified attribute with a value beginning exactly with a given string. |
Attribute | [attribute] | Array<Element(s)> | jQuery('[attribute]') | Selects elements that have the specified attribute, with any value. |
Attribute | [attributeFilter1][attributeFilter2][attributeFilterN] | Array<Element(s)> | jQuery('[attributeFilter1][attributeFilter2][attributeFilterN]') | Matches elements that match all of the specified attribute filters. |
Child Filter | :nth-child(idx/even/odd/eq) | Array<Element(s)> | jQuery(':nth-child(index/even/odd/equation)') | Selects all elements that are the nth-child of their parent. |
Child Filter | :first-child | Array<Element(s)> | jQuery(':first-child') | Selects all elements that are the first child of their parent. |
Child Filter | :last-child | Array<Element(s)> | jQuery(':last-child') | Selects all elements that are the last child of their parent. |
Child Filter | :only-child | Array<Element(s)> | jQuery(':only-child') | Selects all elements that are the only child of their parent. |
Form | :button | Array<Element(s)> | jQuery(':button') | Selects all button elements and elements of type button. |
Form | :checkbox | Array<Element(s)> | jQuery(':checkbox') | Selects all elements of type checkbox. Equivalent to $('[type=checkbox]') |
Form | :checked | Array<Element(s)> | jQuery(':checked') | Matches all elements that are checked. |
Form | :disabled | Array<Element(s)> | jQuery(':disabled') | Selects all elements that are disabled. |
Form | :enabled | Array<Element(s)> | jQuery(':enabled') | Selects all elements that are enabled. |
Form | :selected | Array<Element(s)> | jQuery(':selected') | Selects all elements that are selected. |
Form | :input | Array<Element(s)> | jQuery(':input') | Selects all input, textarea, select and button elements. |
Form | :text | Array<Element(s)> | jQuery(':text') | Selects all elements of type text. |
Form | :password | Array<Element(s)> | jQuery(':password') | Selects all elements of type password. |
Form | :radio | Array<Element(s)> | jQuery(':radio') | Selects all elements of type radio. |
Form | :submit | Array<Element(s)> | jQuery(':submit') | Selects all elements of type submit. |
Form | :image | Array<Element(s)> | jQuery(':image') | Selects all elements of type image. |
Form | :reset | Array<Element(s)> | jQuery(':reset') | Selects all elements of type reset. |
Form | :file | Array<Element(s)> | jQuery(':file') | Selects all elements of type file. |
Form | :hidden | Array<Element(s)> | jQuery(':hidden') | ???? |