JSFiddle - React, Tailwind, and code Playground

HTML

<span onclick="alert('Boem')">
    <button id="test1">test</button>
</span>

JavaScript

$( "#test1" ).on( "click", function(ev) {
    ev.stopPropagation();
});
$('#test1').trigger('click');