Javascript examples for DOM:Event
The currentTarget event property returns the element who triggered the event.
A reference to the object whose event listeners triggered the event
The following code shows how to get where is the event from.
<!DOCTYPE html> <html> <body onclick="myFunction(event)"> <p>Click on a paragraph. </p> <script> function myFunction(event) {//from w w w . j a v a 2 s. c o m console.log(event.currentTarget.nodeName); } </script> </body> </html>