What you need to know
A list can contain many buttons or be updated after the page loads. Event delegation reduces individual listeners and lets newly inserted children use the same behavior.
How to apply it
Listen on a parent, inspect event.target or closest() for the intended control, and verify the target belongs to that list. Keep the action name and data attributes explicit.
Common mistake to avoid
Do not rely on a broad selector that might catch nested controls from another component. Check the event path and stop propagation only when the interaction requires it.
