JSFiddle - React, Tailwind, and code Playground
HTML
<div class="wrapper-alert"> <!-- click here will pop-up -->
<div class="somethingElse"> <!-- click here will pop-up -->
Some text
</div>
<div class="this-is-my-action">
<button class="inside-alert">Inside</button> <!-- click here will NOT pop-up-->
</div>
<div class="somethingElseTo"> <!-- click here will pop-up -->
Some text
</div>
</div>
CSS
.wrapper-alert{
width: 300px;
height: 300px;
background: red;
position: relative;
}
.this-is-my-action{
border :solid blue;
margin: 20px 0 0;
float: left;
}
.somethingElse{
border: solid yellow;
width: 200px;
height: 100px;
}
.somethingElseTo{
position: absolute;
bottom: 0;
border: solid yellow;
height: 100px;
width: 200px;
}
JavaScript
$(".wrapper-alert").on("click", function(e){
alert('this is my WRAPPER' + e.target); // something will happen
});
$(".inside-alert").on("click", function(e){
alert('this is my BUTTON' + e.target); // dont pop-up anything
});