currentTarget Event Property
Get the element that triggered the event:
Get the name of the element that triggered the event:
More examples below.
Definition and Usage
currentTarget property returns the element whose event listener triggered the event.
currentTarget property is read-only.
currentTarget property is useful during capturing and bubbling.
target property refers to the element whose
event listener triggered the event, opposed to the
property, which returns the element that triggered the event.
|Return Value:||An Object.
The object whose event listeners triggered the event.
|DOM Version:||DOM Level 2 Events.|
Get the element where the event occurred:
Get the name of the element where the event occurred:
event.currentTarget is a DOM Level 2 (2001) feature.
It is fully supported in all browsers: