JSFiddle - React, Tailwind, and code Playground
by aaronj1335
HTML
<table>
<tbody>
<tr>
<td>
<a href="javascript:void(0)" class=expand>click me</a>
<span>some other content</span>
</td>
<td>
click me too
</td>
</tr>
</tbody>
</table>
JavaScript
$('table').on('click', 'tr :not(".expand")', function(evt) {
if (! $(evt.target).is(selector)) {
console.log('event is firing even though target doesnt match the selector!!!');
} else {
console.log('event is firing as expected');
}
});
var selector = $('table').data('events').click[0].selector;
console.log('running, selector:',selector,new Date());