Home »
MCQs »
jQuery MCQs
Which is the correct syntax to insert content before the <div> elements?
71. Which is the correct syntax to insert content before the <div> elements?
- $("div").before("Text to be added");
- $("div").pretpend("Text to be added");
- $("div").addbefore("Text to be added");
- $("#div").before("Text to be added");
Answer: A) $("div").before("Text to be added");
Explanation:
The correct syntax to insert content before the <div> elements is:
$("div").before("Text to be added");