Skip to content

Event Delegation

Event delegation is a technique where you attach a single event listener to a parent element instead of multiple listeners to individual children. It works because events bubble up.

Single parent listener handles all children via bubbling. Use e.target.closest() to identify targets. Works for dynamically added elements. Reduces memory usage.