Tuesday, 23 July 2013

What are the Type Selectors in Jquery

1.JQUERY TYPE SELECTORS
•input[type="text"].css(‘color’,’blue’);      //jquery Text selectors
•$('textarea') .css(‘color’,’blue’);                //jquery TextAreaSelectors
•input[type="hidden"].val();                       //jquery Hidden Selectors
•input[type="password"]                         //jquery password selctors
•$('select')     // jQuery dropdown selector
•input[type="radio"]  //jQuery Radio Selectors
•input[type="checkbox"]  //jQuery checkbox selector
•$('image')  //jQuery image selector

•input[type="button"]  //jQuery button selector
2.  JQUERY ID SELECTORS
$("#ID")     //Select any elements by ID (#) denotes ID
3. Jquery Class Selectors
 $(“.classname")   //Select any elements by class name ( . ) denotes Class
4. Attribute Exist selectors
$([attribute name])    //select all elements in a page which have a specific attribute.
Ex.   $("[border]").css(‘color’,’red’);

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 "#".