โ 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. Use document.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>
Topics:
HTML DOM
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.