What are selectors in jQuery and how many types of selectors are there?

Answer Posted / chaitanya

To work with an element on the web page, first we need to find them. To find the html element in jQuery we use selectors. There are many types of selectors but basic selectors are:

Name: Selects all elements which match with the given element Name.

#ID: Selects a single element which matches with the given ID

.Class: Selects all elements which match with the given Class.

Universal (*): Selects all elements available in a DOM.

Multiple Elements E, F, G: Selects the combined results of all the specified selectors E, F or G.

Attribute Selector: Select elements based on its attribute value.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain each() function in jquery?

4936


explain width() vs css(‘width’) in jquery

468


Explain the concepts of "$ function" in jquery with an example?

521


How can you add a jquery library in your project?

431


What is the difference between settimeout() and setinterval() methods?

458






What is the difference between $(window).load and $(document).ready?

437


How To Use Ajax In Jquery?

470


Explain the use of the .pushstack() method.

486


Why we need jquery?

481


Explain all the ways to include jquery in a page?

456


How can you apply a style on an element using jQuery?

462


How to run an event handler only once in jQuery?

506


Tell me what is the use of .size() method in jquery?

446


Tell me what does $("div") will select? : jquery mobile

479


How to use it jquery knockout?

478