← Back to HTML DOM
Question 11
Change Link Href and Text
Change Link Href and Text
Select the link with id="homeLink" and change its href attribute to "/home" and its text content to "Go Home". Platform-Provided HTML (READ-ONLY):<div id="navigation"><a id="homeLink" href="#">Link</a></div>Steps: 1. Usedocument.getElementById()to select the link 2. Change its href attribute to "/home" 3. Change its text content to "Go Home"
Expected Output:
<div id="navigation"> <a id="homeLink" href="/home">Go Home</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.