Let’s review what you’ve learned:
- You can register events to DOM elements using the
addEventListener()method takes two arguments: an event type and an event handler function.
- When an event is triggered on the event target, the registered event handler function executes.
- Event handler functions can also be registered as values of
oneventproperties of their event target.
- Event object properties like
.timeStampare used to provide information about the event.
addEventListener()method can be used to add multiple event handler functions to a single event.
removeEventListener()method stops specific event handlers from “listening” for specific events firing.