JSFiddle - React, Tailwind, and code Playground

by Harsh Kansagara

HTML

<script>
function parentDiv(){
    alert('Parent');
}

function childDiv(test,test1,event){
    event.stopPropagation();
    alert('Child');
}
</script>


<div onclick="parentDiv()" style="width:100px; height:100px; background:red;">
    <div onclick="childDiv('test','test1',event)" style="width:50px; height:50px; background:blue">
    </div>
</div>