Event Delegation in JavaScript

You don’t always have to write event listeners for everything. Event delegation lets you add one listener to the parent element and then use the information from the created event object to tell which child element was the target of the event. Here’s how it’s done.


This website is created with Gatsby by Alex Nielsen. I am currently seeking full-time web development positions in the New York City/New Jersey area.