jargon

Frontend & browser·JavaScript in the browser

you put one click handler on the list and read `event.target` to work out which row was clicked.

Event delegation

Attaching a single listener to a common ancestor and using bubbling to serve every descendant, instead of one listener per element. It keeps memory flat as a list grows and works for elements added after the listener was attached, which is why frameworks do it internally. The cost is that you have to check the target yourself, and `event.target` is the deepest node hit, so it usually needs a `closest()` call rather than a direct comparison.

Commonly confused with