CJCoding With Joseph
15free / daySign inCreate account

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. Read document.getElementById("source").textContent.
2. Assign it to the textContent of #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
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.