Lesson 03 · The DOM
Events: Responding to Your User
Wire real interaction with addEventListener: the event object, the events you will use daily, bubbling and delegation, removing listeners, and preventing the browser's defaults.
Prerequisites: The DOM: Creating, Updating & Removing Content
Learning objectives
By the end of this lesson, you will be able to:
- Attach event listeners with addEventListener using named and arrow functions
- Read the event object, distinguishing target from currentTarget
- Serve many elements - including future ones - with one delegated listener
- Remove listeners correctly and stop the browser's default actions with preventDefault