Consider following HTML snippet:

<p>first paragraph<p>
<p>second paragraph<p>
<p>third paragraph<p>
What is the correct jQuery code to set the background color of all p elements to red?
Explanation
$("p") - select all <p> elements on the page .css() - method set one or more CSS properties for every matched element

Fix it! There is no end tag for paragraph element. Here is a right code: <p>first paragraph</p> <p>second paragraph</p> <p>third paragraph</p>

2017 Jun 8, 8:34:18 AM

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
JavaScript quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes