Show Menu
Cheatography

jquery Cheat Sheet (DRAFT) by

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

Selectors

$("*­")
// all elements
$("p.de­mo")
// <p> elements with class=­"­dem­o"
$("p­:fi­rst­")
$("p­:fi­rst­")
// span, descendant of p
$("p > span")
// span, direct child of p
$("p + span")
// span immedi­ately proceeded by a p
$("p ~ span")
/ strong element proceeded by p
$("ul li:fir­st")
/ the first <li> element of the first <ul>
$("ul li:fir­st-­chi­ld")
// the first <li> element of every <ul>
$("ul li:nth­-ch­ild­(3)­")
// third child
why isn't thi saving?

elements