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 the difference between parent() and parents() methods in jquery? : jquery mobile

627


Can we call c# codebehind method using jquery?

558


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

623


What is the use of jquery.data()?

647


What is the difference between jquery.get() and jquery.ajax()?

623


How to select combobox select value and text using jquery?

587


Tell me how do you stop the currently-running animation? : jquery mobile

560


How can you use a jquery library in your project?

594


What is the use of jQuery load method?

667


Explain width() vs css(‘width’)?

556


Does jquery follow w3c recommendations?

655


Back onto jquery ui' can you see jquery ui making more of an impression in the future, lead by the current successes of jquery?

594


How to check data type of any variable in jquery? : jquery mobile

591


Change the url for a hyperlink using jquery?

648


What is the difference between find and children methods?

657