JSFiddle - React, Tailwind, and code Playground
HTML
<div class='mother'>
mother1
<div class='child'>
child1
</div>
</div>
CSS
.child{
cursor:pointer;
}
JavaScript
$(document).ready(function() {
$('.child').click(function() {
var container = $(this).closest('.mother').html();
alert(container);
})
})