DOM Event.target Property
The target property of an event is the element where the event originally happened, such as the exact element that was clicked.
Description
The read-only target property is the object the event was originally dispatched to: for a click, the innermost element under the pointer. As the event bubbles up, target stays the same, while currentTarget changes to the element whose listener is running.
That difference is what makes event delegation work: one listener on a list can use event.target (often with closest()) to find which item was clicked.
For events in shadow DOM, the target seen outside is the shadow host rather than the inner element, a process called retargeting; composedPath() shows the full path. For text node targets, such as some selection events, use target.parentElement to get to an element.
Syntax
event.targetValue
The element (or other object) that the event was dispatched to.
Example
Browser Support
The following information will show you the current browser support for the Event.target property. Hover over a browser icon to see the version that first introduced support for this property.
Desktop





Tablets & Mobile





