*
#id
.class
.class,.class
element
el1,el2,el3
:first
:last
:even
:odd
:first-child
:first-of-type
:last-child
:last-of-type
:nth-child(n)
:nth-last-child(n)
:nth-of-type(n)
:nth-last-of-type(n)
:only-child
:only-of-type
parent > child
parent descendant
element + next
element ~ siblings
:eq(index)
:gt(no)
:lt(no)
:not(selector)
Example
$("*")
$("#lastname")
$(".intro")
$(".intro,.demo")
$("p")
$("h1,div,p")
$("p:first")
$("p:last")
$("tr:even")
$("tr:odd")
$("p:first-child")
$("p:first-of-type")
$("p:last-child")
$("p:last-of-type")
$("p:nth-child(2)")
$("p:nth-last-child(2)")
$("p:nth-of-type(2)")
$("p:nth-last-of-type(2)")
$("p:only-child")
$("p:only-of-type")
$("div
$("div
$("div
$("div
> p")
p")
+ p")
~ p")
$("ul li:eq(3)")
$("ul li:gt(3)")
$("ul li:lt(3)")
$("input:not(:empty)")
:header
:animated
:focus
:contains(text)
:has(selector)
:empty
:parent
:hidden
:visible
:root
:lang(language)
[attribute]
[attribute=value]
[attribute!=value]
[attribute$=value]
[attribute|=value]
[attribute^=value]
[attribute~=value]
[attribute*=value]
:input
:text
:password
:radio
:checkbox
:submit
:reset
:button
:image
:file
:enabled
:disabled
$(":header")
$(":animated")
$(":focus")
$(":contains('Hello')")
$("div:has(p)")
$(":empty")
$(":parent")
$("p:hidden")
$("table:visible")
$(":root")
$("p:lang(de)")
$("[href]")
$("[href='default.htm']")
$("[href!='default.htm']")
$("[href$='.jpg']")
$("[title|='Tomorrow']")
$("[title^='Tom']")
$("[title~='hello']")
$("[title*='hello']")
$(":input")
$(":text")
$(":password")
$(":radio")
$(":checkbox")
$(":submit")
$(":reset")
$(":button")
$(":image")
$(":file")
$(":enabled")
$(":disabled")
:selected
:checked
$(":selected")
$(":checked")
Selects
All elements
The element with id="lastname"
All elements with class="intro"
All elements with the class "intro" or "demo"
All <p> elements
All <h1>, <div> and <p> elements
The first <p> element
The last <p> element
All even <tr> elements
All odd <tr> elements
All
All
All
All
All
All
All
All
All
All
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
elements
elements
elements
elements
elements
elements
elements
elements
elements
elements
that
that
that
that
that
that
that
that
that
that
are
are
are
are
are
are
are
are
are
are
the
the
the
the
the
the
the
the
the
the
elements
elements
elements
elements
elements
elements
elements
elements
with
with
with
with
with
with
with
with
a
a
a
a
a
a
a
a
href attribute
href attribute value equal to "default.htm"
href attribute value not equal to "default.htm"
href attribute value ending with ".jpg"
title attribute value equal to 'Tomorrow', or starting wi
title attribute value starting with "Tom"
title attribute value containing the specific word "hello
title attribute value containing the word "hello"
All
All
All
All
All
All
All
All
All
All
All
All
input elements
input elements with type="text"
input elements with type="password"
input elements with type="radio"
input elements with type="checkbox"
input elements with type="submit"
input elements with type="reset"
input elements with type="button"
input elements with type="image"
input elements with type="file"
enabled input elements
disabled input elements