Event Delegation

Hey, guys!
I came here from this tutorial on Kirupa’s channel.
It deals with Event Delegation. I would really appreciate it if someone could help me with my question here:

I am working on a chat app. Each chat element has children of its own. And all the chats are inside of a chatContainer.

Now, if I add the event listener to the chatContainer, how do I execute the callback only on the parent element(chat) even though the event was triggered by one of its children(chatChild)?

Welcome to the forum @abishek07! :grinning:

You can add the event listener to the parent container, and that may be all you need to do. If you tried that, was the event not reaching it?

Kirupa :alien: