CJCoding With Joseph

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>
Topics:
HTML DOM
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.