Show Menu
Cheatography

jQuery Cheat Sheet (DRAFT) by

jQuery 10

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

Basics

*
.class
element
#id
selector1, selectorN, ...
Hierarchy
parent > child
ancestor descendant
prev + next
prev ~ siblings

Basic Filters

:animated
:eq()
:even
:first
:gt()
:header
:lang()
:last
:lt()
:not()
:odd
:root
:target

Content Filters

:conta­ins()
:empty
:has()
:parent
Visibility Filters
:hidden
:visible
Attribute
[name|­="va­lue­"]
[name*­="va­lue­"]
[name~­="va­lue­"]
[name$­="va­lue­"]
[name=­"­val­ue"]
[name!­="va­lue­"]
[name^­="va­lue­"]
[name]
[name=­"­val­ue"]­[na­me2­="va­lue­2"]

Child Filters

:first­-child
:first­-of­-type
:last-­child
:last-­of-type
:nth-c­hild()
:nth-l­ast­-ch­ild()
:nth-l­ast­-of­-type()
:nth-o­f-t­ype()
:only-­child
:only-­of-­type()