DEV Community 👩‍💻👨‍💻

Alex Nielsen
Alex Nielsen

Posted on

Event delegation in JavaScript

I have been making web development videos to help me solidify what I've been learning. This one is about event delegation in JavaScript. How to add one listener to multiple elements.

Latest comments (3)

jay97 profile image
Jamal Al

Hey Alex nice vedio. In the video i saw the u were trying to get the like this el.addEventListner("click", console.log(
But did not work. To make it work just pass {target} to console without event.

jess profile image
Jess Lee

Hey Alex, just thought you might want to know that you can embed your videos directly in with this syntax:

{% youtube buVEB6TI3VU %}

bushbass profile image
Alex Nielsen Author

Thank you! :)

Need a better mental model for async/await?

Check out this classic DEV post on the subject.

⭐️🎀 JavaScript Visualized: Promises & Async/Await

async await