jQuery Cheat Sheet by i3quest
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.
Download the jQuery Cheat Sheet
Like this cheat sheet? Check out our sponsors!
Readability-Score.com is a collection of tools to make your writing better. More readabile content means higher conversion rates and better reader engagement. Measure website and document readability, measure keyword density and more!
Click Here To Get Started!