JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/ui-lightness/jquery-ui.css">
<div class='foobar'>
    <span>child</span>
</div>

CSS

.foobar {
    padding: 20px;
    background: yellow;
}

span {
    background:blue;
    color: white;
    padding: 8px;
}

JavaScript

$('.foobar').on('click', function(e) {
    if (e.target !== this) return;

    alert( 'clicked the foobar' );
});