JSFiddle - React, Tailwind, and code Playground

by Ahmad Baktash Hayeri

HTML

<div class="parent">
    <div class="child"></div>
</div>

CSS

.parent{
    width: 100%;
    height: 200px;
    background: gray;
    position:relative;
}

.child{
    position:absolute;
    width: 40%;
    height: 40%;
    background: pink;
}

JavaScript

$(function(){
	$('.parent').click(function(){
    	alert('clicked');
    });
    
    $('.child').click(function(){
    	return false;
    });
});