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

How to execute jQuery code after the DOM is ready?

625


How to prevent Right Click option using jquery?

627


What is the use of jQuery filter?

592


How can events be prevented to work after an ajax request?

587


How to validate email using jquery?

615


Can you please explain the difference between javascript and jquery? : jquery mobile

590


How to concatenate two strings using jquery?

640


What is ajax and how it works?

614


Define jquery filter?

642


What are selectors in jquery? Explain

624


Name some of the methods of jquery used to provide effects?

611


What is cdn? Explain

596


What features of jquery, has been used in web applications?

597


Explain the difference between .empty() and .remove() ?

587


Explain the difference between find and children methods in jquery?

615