List of common jQuery selectors. I had compiled this list a while ago into a word document but do not remember the source now.
Contains Prefix (before hyphen (-))
input, textarea, select and button elements
Elements that contain the specified text.
Element at index n within the matched set.
Elements at an index greater than n within the matched set.
Elements at an index less than index within the matched set.
Elements which contain at least one element that matches the specified selector.
Elements that do not match the given selector.
Elements that are the nth-child of their parent.
Elements that have no children (including text nodes).
Even elements, zero-indexed.
The first matched element.
Elements that are headers, like h1, h2, h3 and so on.
The last matched element.
Odd elements, zero-indexed.
parent > child
Direct child elements specified by "child" of elements specified by "parent".
Elements that are descendants of a given ancestor.
selector1, selector2, selectorN
Combined results of all the specified selectors.
prev + next
Next elements matching "next" that are immediately preceded by a sibling "prev".
prev ~ siblings
Sibling elements that follow after the "prev" element, have the same parent, and match the filtering "siblings" selector.
Elements that are the first child of their parent.
Elements that are the last child of their parent.
Elements that are the only child of their parent.
Elements that are the parent of another element, including text nodes.
Help Us Go Positive!
We offset our carbon usage with Ecologi. Click the link below to help us!