jQuery Multiple choices


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

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


 

 

 

 



A


Solution:-

The following jQuery code to set the background color red of all p elements in a document.

To set the background color using jQuery, use the jQuery CSS() property. We will set the background color on mouse hover with the jQuery on() method.

The following example shows how to set the background color of an element using the Jquery code:

$("p").css("background-color","yellow");

 




Next 5 multiple choice(s)

1

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

2

Which jQuery method is used to hide selected elements?

3

Which jQuery method is used to set one or more style properties for selected elements?

4

Which jQuery method is used to perform an asynchronous HTTP request?

5

What is the correct jQuery code for making all div elements 100 pixels high?

Comments