What are different type of selector in jQuery?
Swaraj Patil
There are various selectors in jQuery but the most popular are: 1. ID Selector - Selects the element with the id using the '#' keyword as $("#username") 2. Class Selector - Selects the element with the class name using the '.' keyword as $(".students") 3. Element Selector - Selects the element using its type. For example if the element is a paragraph
, then it goes like $("p")
http://www.w3schools.com/jquery/jquery_ref_selectors.asp
view this link for jquery selector with example http://www.w3schools.com/jquery/jquery_selectors.asp
For more selector visit below link http://api.jquery.com/category/selectors/
Following are selectors in jQuery to access element using jQuery - 1) Class Selector $(".classbane") 2) Id Selector $("#div1") 3) Element Selector $("p") 4) Universal (all elements) $("*")There are many more selectors to select based on input type, attribute value