currentTarget Event PropertyEvent Object
Definition and Usage
The currentTarget event property returns the element whose event listeners triggered the event.
This is particularly useful during capturing and bubbling.
The following example gets the element whose event listeners triggered the event:
alert("The id of the triggered element: " + x.id);
<p id="p1" onclick="myFunction(event)">
Click on this paragraph. An alert box will
show which element triggered the event.</p>
Try it yourself »
Thank You For Helping Us!
Your message has been sent to W3Schools.