DOM Manipulation

Element Styles

Element Styles

Every element has a style object for inline styles. JavaScript property names use camelCase, so the CSS property background-color becomes backgroundColor.

Inline styles are useful for state that is calculated by JavaScript, such as progress, coordinates, or values that come from data.

Your task: Select the notice and set its background color to gold and its font weight to 700. Keep the notice text unchanged.

Free with a JS Exercises account

Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.

By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.

Element Styles

Every element has a style object for inline styles. JavaScript property names use camelCase, so the CSS property background-color becomes backgroundColor.

Inline styles are useful for state that is calculated by JavaScript, such as progress, coordinates, or values that come from data.

Your task: Select the notice and set its background color to gold and its font weight to 700. Keep the notice text unchanged.

Free with a JS Exercises account

Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.

By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.

Console

Run code to see output.