currentTarget Event Property - Javascript DOM

Javascript examples for DOM:Event


The currentTarget event property returns the element who triggered the event.

Return Value

A reference to the object whose event listeners triggered the event

The following code shows how to get where is the event from.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<body onclick="myFunction(event)">

<p>Click on a paragraph. </p>

function myFunction(event) {//from w w  w . j  a v a  2  s.  c o m


Related Tutorials