← Back to HTML DOM
Question 12
Change Multiple CSS Styles
Change Multiple CSS Styles
Select the paragraph with id="styledText" and change its color to "blue", fontSize to "20px", and backgroundColor to "lightyellow". Platform-Provided HTML (READ-ONLY):<div id="content"><p id="styledText">Style me with JavaScript!</p></div>Steps: 1. Usedocument.getElementById()to select the paragraph 2. Use the style property to change color, fontSize, and backgroundColor 3. Remember: CSS properties use camelCase in JavaScript (background-color becomes backgroundColor)
Expected Output:
<div id="content"> <p id="styledText" style="color: blue; font-size: 20px; background-color: lightyellow;">Style me with JavaScript!</p> </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.