jQuery Tutorial


jQuery Example


jQuery References


Complate jQuery Selectors Tutorial References Examples




jQuery Selector References

Following some jQuery Selector References...

Selector Example Description
* $("table *") Select All Elements.
#id $("#name") Selected element with id="name".
.class $(".name") Selected elements with class="name".
tag $("p") Selected All p elements.

Selector Example Description
:first $("p:first") first <p> element.
:last $("p:last") last <p> element.
:even $("p:even") Perform all even <tr> elements.
:odd $("p:odd") Perform all odd <tr> elements.

Selector Example Description
:enabled $(":enabled") All enabled elements.
:disabled $(":disabled") All disabled elements.
:selected $(":selected") All selected elements.
:checked $(":checked") All checked elements.

Selector Example Description
:input $(":input") selected All input elements.
:text $(":text") selected All input elements with type="text".
:button $(":button") selected All input elements with type="button".
:password $(":password") selected All input elements with type="password".
:radio $(":radio") selected All input elements with type="radio".
:checkbox $(":checkbox") selected All input elements with type="checkbox".
:image $(":image") selected All input elements with type="image".
:file $(":file") selected All input elements with type="file".
:submit $(":submit") selected All input elements with type="submit".
:reset $(":reset") selected All input elements with type="reset".

Selector Example Description
:header $(":header") Selected All header elements h1...h6.
:animated $(":animated") Selected All animated elements.
:hidden $("p:hidden") Selected All hidden p elements.
:visible $("tr:visible") Selected All visible table rows.
:empty $(":empty") Selected All elements with no child of the elements.
:contains(text) $(":contains('Way2Tutorial')") Select All elements which contains is text.

Selector Example Description
[attribute] $("[href]") Select All elements with a href attribute.
[attribute$=value] $("a:[href$=.org]") Selected elements with a href attribute value ending with ".org".
[attribute=value] $("a:[href=#]") Selected elements with a href attribute value equal to "#".
[attribute!=value] $("a:[href!=#]") Selected elements with a href attribute value not equal to "#".