Home »
MCQs »
jQuery MCQs
Which is the correct syntax to insert content at the beginning of the <p> elements?
69. Which is the correct syntax to insert content at the beginning of the <p> elements?
- $("#p").before("Text to be added");
- $("p").addafter("Text to be added");
- $("p").after("Text to be added");
- $("p").prepend("Text to be added");
Answer: D) $("p").prepend("Text to be added");
Explanation:
The correct syntax to insert content at the beginning of the <p> elements is:
$("p").prepend("Text to be added");