Caffeinated Coder
Book an appointment
Lesson 23 · JavaScript in the browser

Events

An event is the browser telling your code that something happened: a click, a key press, a form being sent. Follow one click on a to-do list: the browser makes an event object, carries it down the DOM tree to the button and back up, and the single listener on the list runs, finds the clicked row and crosses it out. Then a second click shows why one listener on a parent can serve every child: event delegation.

11 min10 steps5 questionsIntermediate
Fig 23 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.