Key Concepts

Review core concepts you need to learn to master this subject

.addEventListener()

eventTarget.addEventListener("event", eventHandlerFunction);

The .addEventListener() method attaches an event handler to a specific event on an event target. The advantage of this is that you can add many events to the event target without overwriting existing events. Two arguments are passed to this method: an event name as a string, and the event handler function. Here is the syntax:

DOM Events with JavaScript
Lesson 1 of 1

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo