I\'m trying to create one event listener to handle all my \"clicks\" by putting it on the body and doing some event delegation. A simple example of what i\'m trying to do i
There are two elements associated with an event:
These can be the same element, parent and child, or ancestor and descendant (which is the case here).
So a click on an LI makes it the target, and since the body's click handler calls the listener, it's the currentTarget, the DIV is neither. If you put the listener on the DIV, it will then become the currentTarget.
Originally, nodes other than elements could be event targets, but in recent implementations only elements are targets.
Some links:
Note that that target and eventTarget are specified as (host) objects, they aren't necessarily elements though that is how they are mostly implemented in current browsers.