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?

  1. $("#p").before("Text to be added");
  2. $("p").addafter("Text to be added");
  3. $("p").after("Text to be added");
  4. $("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");

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.