JSFiddle - React, Tailwind, and code Playground
HTML
<div class="red">
<input type="text" />
</div>
CSS
.red {
background-color: red;
padding: 30px;
}
JavaScript
$('input').keyup(function(e) {
e.stopPropagation();
alert('KeyUp on Input');
});
$('.red').keyup(function(e) {
alert('KeyUp on the red carpet!'); // Will never appear
})
$('body').keyup(function(e) {
alert('KeyUp out of an Input');
});