I\'m trying to do event delegation in vanilla JS. I have a button inside a container like this
Alternate Solution:
MDN: Pointer events
Add a class to all nested child elements (.pointer-none)
.pointer-none {
pointer-events: none;
}
Your mark-up becomes
With the pointer set to none, the click event wouldn't fire on those elements.
https://css-tricks.com/slightly-careful-sub-elements-clickable-things/