JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<a href="#">Click me (should be ignored)</a>
</div>
CSS
div {
background:red;
padding:50px;
}
a {
display:block;
color: white;
text-align:center;
text-decoration:none;
margin-bottom:20px;
}
JavaScript
$('body').on('click', function (e) {
if ($(e.target).is(':not(a)')) {
alert('got a click');
}
});