JSFiddle - React, Tailwind, and code Playground
HTML
<div onClick="someJScode();" class="parent">
<div class="child" onclick="childCallback(event)"></div>
</div>
CSS
.parent {
width: 200px;
height: 200px;
background: red;
}
.child {
width: 100px;
height: 100px;
background: blue;
}
JavaScript
function someJScode() {
alert('Click!');
}
function childCallback(event) {
event.stopImmediatePropagation();
alert("failed");
}