When a click listener runs on a broad container such as document, event.target identifies the original element where the event began. For a button click, it is the button—the first stop before bubbling continues. section 14.3
Separate the three useful views of a propagating event:
- event.target is the originating element. section 14.3
- event.currentTarget is the element where the listener was registered, such as document. section 14.3
- event.composedPath() returns the complete bubbling path, from the clicked element through containing nodes to Window. section 14.3
Inspecting a Web Component click
A document-level click listener can log e.target, e.currentTarget, and e.composedPath() while a custom element supplies a clickable button. The resulting path includes the button, the component, body, html, document, and Window.


