Tuesday, 23 July 2013

Jquery Selectors Part II

Selector
Example
Description
:reset
$(":reset")
selected All input elements with type="reset".
: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(‘hello')")
Select All elements which contains is text.
[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=#]")
elected elements with a href attribute value equal to "#".
[attribute!=value]
$("a:[href!=#]")
Selected elements with a href attribute value not equal to "#".