currentTarget event property
Definition and Usage
The currentTarget event property returns the element that triggered the event with the event listener.
This is particularly useful during the capture and bubble phases.
The currentTarget property always refers to the element that triggered the event, unlike the target property, which returns the element that triggered the event.
Instance
Obtain the element that triggers a specific event with the event listener:
alert(event.currentTarget);
Syntax
event.currentTarget
Technical Details
Return Value: | Reference to the object that triggers the event to its event listener. |
---|---|
DOM Version: | DOM Level 2 Events |
Browser Support
The numbers in the table indicate the first browser version that fully supports the property.
Properties | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
currentTarget | Support | 9.0 | Support | Support | Support |