← Back to HTML DOM
Question 175
Copy Text From One Element to Another
Copy Text From One Element to Another
Read the text from the span with id="source" and copy it into the span with id="dest" so both read "Hello". Platform-Provided HTML (READ-ONLY):<div id="labels"><span id="source">Hello</span><span id="dest"></span></div>Steps: 1. Readdocument.getElementById("source").textContent. 2. Assign it to thetextContentof#dest.
Expected Output:
<div id="labels"> <span id="source">Hello</span> <span id="dest">Hello</span> </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.