bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/JavaScript/DOM and Browser APIs
JavaScript•DOM and Browser APIs

HTML DOM - Changing CSS

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind HTML DOM - Changing CSS?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___.getElementById( id ).style.
3Order

Put the learning moves in the order that makes the concept easiest to apply.

To change the style of an HTML element, use this syntax:
The HTML DOM allows JavaScript to change the style of HTML elements.
Changing HTML Style

Changing HTML Style

The HTML DOM allows JavaScript to change the style of HTML elements.

To change the style of an HTML element, use this syntax:

document.getElementById( id ).style.
property = new style
<p>

Using Events

The HTML DOM allows you to execute code when an event occurs.

Events are generated by the browser when "things happen" to HTML elements:

  • An element is clicked on
  • The page has loaded
  • Input fields are changed

You will learn more about events in the next chapter of this tutorial.

id="id1"

Previous

HTML DOM - Changing HTML

Next

HTML Form Validation