Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

jQuery Cheat Sheet

by i3 Quest Inc (i3quest) via cheatography.com/341/cs/168/


General

Functions

All

element

:contains(text)

Element

.class

Class

#id

ID

:eq(n)

Elements that contain the

parent >

Direct child elements specified by

specified text.

child

"child" of elements specified by

:gt(n)

Elements at an index greater


than n within the matched set.

[name]

Has Attribute

[name|="value"]

Contains Prefix
(before hyphen (-))

[name*="value"]

Contains

[name~="value"]

Contains Word

[name^="value"]

Starts With

[name$="value"]

Ends With

[name="value"]

Equals

[name!="value"]

Not Equal

[name="v"][name2="v2"]

Multiple Attributes

Controls
Button

:lt(n)

Elements at an index less than


index within the matched set.

:has(selector)

Elements which contain at least

Elements that are descendants of

descendant

a given ancestor.

selector1,

Combined results of all the

selector2,

specified selectors.

selectorN
prev + next

:not(selector)

Elements that do not match the


given selector.

:nth-child()

a sibling "prev".

:empty

prev ~

Sibling elements that follow after

siblings

the "prev" element, have the same


parent, and match the filtering

Elements that are the nth-child


of their parent.
Elements that have no children
(including text nodes).

:even

Even elements, zero-indexed.

:first

The first matched element.

:header

Elements that are headers, like


h1, h2, h3 and so on.

:submit

Submit

:text

Text

:password

Password

Element State

:radio

Radio

:checked

Checked

:reset

Reset

:animated

Animated

:file

File

:disabled

Disabled

:image

Image

:enabled

Enabled

:input

input, textarea, select and button

:focus

Focused

:selected

Selected

:visible

Visible

:hidden

Hidden

Next elements matching "next"


that are immediately preceded by

specified selector.

Checkbox

Cheatographer

ancestor

one element that matches the

:checkbox

elements

"parent".

Element at index n within the


matched set.

Attributes

:button

Hierarchy

"siblings" selector.
:first-child

Elements that are the first child of


their parent.

:last-child

Elements that are the last child of


their parent.

:only-child

Elements that are the only child of


their parent.

:parent

Elements that are the parent of

:last

The last matched element.

another element, including text

:odd

Odd elements, zero-indexed.

nodes.

Cheat Sheet

Sponsor

i3 Quest Inc (i3quest)

This cheat sheet was published on 24th December,

Envoy, for simple and effective bug management.

cheatography.com/i3quest/

2011 and was last updated on 24th December,

Try it free!

www.i3quest.com

2011.

http://www.envoyapp.com

You might also like