<!DOCTYPE html>
<html>
<body onclick="myFunction(event)" style="border:1px solid black;Padding:8px">
<h1>HTML DOM Events</h1>
<h2>The currentTarget Property</h2>
<p>Click on any elements in this document to find out which element triggered the onclick event.</p>
<p>The <b>currentTarget</b> property refers to the element whose event listener triggered the event.</p>
<p>This is opposed to the <b>target</b> property, which returns the element that triggered the event.</p>
<p id="demo"></p>
<script>
function myFunction(event) {
let element = event.currentTarget;
document.getElementById("demo").innerHTML = element;
}
</script>
</body>
</html>