Google News
logo
jQuery - Interview Questions
What are selectors in jQuery? How many types of selectors in jQuery ?
If you want to work with an element on the web page, first you need to find it. Selectors are used to find the HTML elements in jQuery. There are many types of selectors. Some basic selectors are:

1. Name Selectors - It is used to selects all elements which match with the given element Name. Ex : $("p") ,  $("h1"),  $("h2"), etc.
2. ID(#) Selectors  - It is used to selects a single element which matches with the given ID. Ex : $("#test") 
3. class(.) Selectors - It is used to selects all elements which match with the given Class. Ex : $(".test")

and more selectors please click here!
Advertisement