Home »
MCQs »
jQuery MCQs
Which is the correct jQuery statement to set background color and text decoration to all <p> elements?
82. Which is the correct jQuery statement to set background color and text decoration to all <p> elements?
- $("p").css({"background-color": "#f1f1f1"; "text-decoration": "underline"});
- $("#p").css({"background-color": "#f1f1f1"; "text-decoration": "underline"});
- $("p").css({"background-color": "#f1f1f1", "text-decoration": "underline"});
- $("#p").css({"background-color": "#f1f1f1", "text-decoration": "underline"});
Answer: C) $("p").css({"background-color": "#f1f1f1", "text-decoration": "underline"});
Explanation:
The correct jQuery statement to set background color and text decoration to all <p> elements is:
$("p").css({"background-color": "#f1f1f1", "text-decoration": "underline"});