JSFiddle - React, Tailwind, and code Playground
HTML
<div id="main">
<div id="child"></div>
</div>
CSS
#main{
width: 100px;
height: 100px;
background: #999;
padding-top: 25px;
box-sizing: border-box;
}
#child{
width: 50px;
height: 50px;
margin-left: 25px;
background-color: blue;
}
JavaScript
document.getElementById('main').addEventListener('click', function(event){
console.log(this == event.currentTarget, event.target);
});