← Back to HTML DOM
Question 19
Update a Link's Destination
Update a Link's Destination
Select the link with id="navLink" and change its href to "https://example.com" and its text content to "Visit Example". Platform-Provided HTML (READ-ONLY):<div id="navigation"><a id="navLink" href="#">Old Link</a></div>Steps: 1. Usedocument.getElementById()to select the link 2. Change its href attribute to "https://example.com" 3. Change its textContent to "Visit Example"
Expected Output:
<div id="navigation"> <a id="navLink" href="https://example.com">Visit Example</a> </div>
= newline. No newline after the last line.
Hints4 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.