Add CSS Class to Heading
easyQuestion 8Select the heading with id="pageTitle" and add the CSS class "highlight" to it.
Platform-Provided HTML (READ-ONLY):
<div id="page">
<h1 id="pageTitle">Welcome</h1>
</div>Steps:
1. Use document.getElementById() to select the heading
2. Use classList.add() to add the "highlight" class
Expected output
<div id="page"> <h1 id="pageTitle" class="highlight">Welcome</h1> </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.