JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parent">
<div class="child"></div>
</div>
CSS
.child {
height: 10px;
background: #eee;
}
.parent {
position: relative;
padding: 45px;
background: #aaa;
}
JavaScript
$('.parent').click(function() {
alert(1);
$(this).find('.child').click();
});
$('.child').click(function(e) {
e.stopPropagation(); // Prevent bubbling to parent, to avoid loop
alert(2);
});