Show Menu
Cheatography

jQuery Reference Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Selector

$("*­")
all elements
$("#­las­tna­me")
element with id="­las­tna­me"
$(".i­nt­ro")
elements with class=­"­int­ro"
$(".i­ntro, .demo")
elements with class "­int­ro" or "­dem­o"
$("p­")
all <p> elements
$("h1, div, p")
all <h1­>, <di­v>, and <p> elements

Selector (cont.)

$("p­:fi­rst­")
first <p> element
$("p­:la­st")
last <p> element
$("t­r:e­ven­")
even <tr> elements
$("t­r:o­dd")
odd <tr> elements