Remove an Element
easyQuestion 16Select the paragraph with id="removeMe" and remove it from the page.
Platform-Provided HTML (READ-ONLY):
<div id="content">
<p id="removeMe">This paragraph will be removed.</p>
<p>This paragraph stays.</p>
</div>Steps:
1. Use document.getElementById() to select the paragraph
2. Use the .remove() method to delete it from the DOM
Expected output
<div id="content"> <p>This paragraph stays.</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.