currentTarget Event Property
Example
Get the element that triggered the event:
Get the name of the element that triggered the event:
More examples below.
Description
ThecurrentTarget property returns the element whose event listener triggered the event.
ThecurrentTarget property is read-only.
ThecurrentTarget property is useful during capturing and bubbling.
Thecurrenttarget property refers to the element whose event listener triggered the event, opposed to thetarget property, which returns the element that triggered the event.
See Also:
Syntax
Technical Details
| Return Value: | An Object. The object whose event listeners triggered the event. |
|---|---|
| DOM Version: | DOM Level 2 Events. |
More Examples
Example
Get the name of the element where the event occurred:
Browser Support
event.currentTarget is a DOM Level 2 (2001) feature.
It is fully supported in all browsers:
| Chrome | Edge | Firefox | Safari | Opera | IE |
| Yes | Yes | Yes | Yes | Yes | 9-11 |

