DOM Event.currentTarget Property
The currentTarget property of an event is the element that the running event listener is attached to.
Description
The read-only currentTarget property identifies the element whose listener is currently being called, which may differ from target when the event has bubbled from a child. Inside a regular function listener, this is the same as currentTarget; in an arrow function, use currentTarget. It's null once the event has finished dispatching.
When you attach the same function to several elements, currentTarget tells you which one is handling the event, which is handy for reading its data attributes. In delegated listeners, it's always the container you attached the listener to.
If you need it after the handler finishes, such as in a promise callback or a setTimeout(), store it in a variable first, because the property is reset to null once dispatching is complete.
Syntax
event.currentTargetValue
The element whose event listener is currently running, or null outside a handler.
Example
Browser Support
The following information will show you the current browser support for the Event.currentTarget property. Hover over a browser icon to see the version that first introduced support for this property.
Desktop





Tablets & Mobile





