Learn
Congrats, you completed the lesson! Now you’ve learned about JavaScript events and you can leverage these events on the DOM to create interactivity with event handlers.
Let’s review what you’ve learned:
- You can register events to DOM elements using the
addEventListener()
method. - 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
onevent
properties of their event target. - Event object properties like
.target
,.type
, and.timeStamp
are used to provide information about the event. - The
addEventListener()
method can be used to add multiple event handler functions to a single event. - The
removeEventListener()
method stops specific event handlers from “listening” for specific events firing.
Sign up to start coding
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.