⇧
vadnica-logo
My Services About the Project Telegram O meni O meni

Event Delegation in Practice

If we have a large number of buttons on a page (e.g., a list of employees or departments), adding an event listener to each individual button wastes memory. With event delegation, we listen for clicks on a common parent (container) and precisely capture the target using e.target as the event bubbles up.

EXAMPLE
RESULT