2 ms·
The problem with attaching the listener to the 'actual' target is that it goes wrong when your markup is dynamic and so the target element is not (always) there
by mercer 10y ago
The problem with attaching the listener to the 'actual' target is that it goes wrong when your markup is dynamic and so the target element is not (always) there the moment you create the listener.
This is why one of the early lessons you learn as a jQuery user is to use $().on() instead of something like $().click();
Plus, while I don't suppose it's a real performance issue much of the time, adding an event listener to each of, say, a few hundred items in a list is probably rather inefficient compared to adding it to the root element of the list.