WeCodeAcademy

The DOM and Events

The DOM is the page as JavaScript sees it. You can find elements, change them, and react to clicks.

Examplehtml
Open in editor »

Click the button in the result. addEventListener runs a function whenever the event happens.

Quick check

Which method runs a function when a click happens?

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.