jQuery Multiple choices


Total available count: 24
Subject - JavaScript Frameworks
Subsubject - jQuery

With jQuery, look at the following selector: $("div.intro"). What does it select?


 

 

 

 



D


Solution:-

With jQuery, The selector: $("div.intro") selects all div elements with class="intro"

From the above jQuery selector example, it selects all div elements that contain a class called "intro" , some of the jQuery Selectors is as follows:

Selector

Example

Selects

#id

$("#lastname")

The element with id="lastname"

.class

$(".intro")

All elements with class="intro"

.class,.class

$(".intro,.demo")

All elements with the class "intro" or "demo"

element

$("p") 

All <p> elements

 




Next 5 multiple choice(s)

1

What is the correct jQuery code to set the background color of all p elements to red?

2

The jQuery html() method works for both HTML and XML documents

3

Is it possible to use jQuery together with AJAX?

4

Is jQuery a library for client scripting or server scripting?

5

Look at the following selector: $("div"). What does it select?

Comments