Responding to Events
Responding to Events: Responding to Events: an overview, Imperative.
Updated
- Responding to Events: an overview (Apprentice): An event is something that happens on a page, such as a click, and your code responds to it by giving the browser a function to run each time it happens.
- Imperative (Apprentice): In the imperative style, your JavaScript finds an element and attaches a handler to it with addEventListener, so the HTML holds no JavaScript at all.