CJCoding With Joseph
15free / daySign inCreate account

Append a Paragraph to a Container

Create a new <p> element with the text "New paragraph" and append it inside the empty div with id="box".

Platform-Provided HTML (READ-ONLY):
<div id="box">
</div>

Steps:
1. Create the element with document.createElement("p").
2. Set its textContent to "New paragraph".
3. Append it with box.appendChild().

Expected Output:

<div id="box">
  <p>New paragraph</p>
</div>

= newline. No newline after the last line.

Hints4 available
Topics:
HTML DOM
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (clog, fn, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.