Skip to content

Glossary: JavaScript in the Browser

Event delegation

Putting one listener on a parent and using event.target with closest to work out which child was clicked. It also works for children added later, as with the shop's Add to cart buttons.

Where the book teaches it

Related terms

Bubblingclosest