JAVASCRIPT EVENT.TARGET

JavaScript
Using the event.target property together with the element.tagName property to find out which element triggered a specified event:

<body onclick="myFunction(event)">
<p>Click on any elements in this document to find out which element triggered the onclick event.</p>
<h1>This is a heading</h1>
<button>This is a button</button>
<p id="demo"></p>

<script>
function myFunction(event) { 
  var x = event.target;
  document.getElementById("demo").innerHTML = "Triggered by a " + x.tagName + " element";
}
</script>event.target returns the node that was targeted by the function. 
This means you can do anything you would do with any other node like one
you'd get from document.getElementByIdconst theTarget = someEvent.target;
Source

Also in JavaScript: