Move an Element Into Another Container
hardQuestion 190Move the paragraph with id="item" out of the div with id="source" and into the div with id="target". Appending an existing element to a new parent removes it from its old parent automatically.
Platform-Provided HTML (READ-ONLY):
<div id="source">
<p id="item">Draggable</p>
</div>
<div id="target">
</div>Steps:
1. Select both #target and #item.
2. Call target.appendChild(item), which moves the paragraph into the target.
Expected output
<div id="source"> </div> <div id="target"> <p id="item">Draggable</p> </div>
= newline. No newline after the last line.
Hints2 available
Sign in to use hintsTopics
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.