JSFiddle - React, Tailwind, and code Playground

HTML

<div id="container">
    <div id="nested">
        <span id="someElement">Some Text</span>
    </div>
</div>

CSS

#container {
    width: 500px;
    height: 500px;
    background-color: yellow;
    border: 1px solid black;
}

#nested {
    width: 100px;
    height: 100px;
    background-color: red;
}

#someElement {
    background-color: green;
}

JavaScript

$("#container").click(function(){
  alert("container was clicked");
}).children().click(function(e) {
  e.stopPropagation();
});