JSFiddle - React, Tailwind, and code Playground

HTML

<button class="tablesaw-sortable-btn">
       <div class="checkbox checkbox-success">
        <input id="test" name="test" type="checkbox">
       
      </div>
    </button>

JavaScript

$(function(){    
    $("button.tablesaw-sortable-btn")[0].addEventListener('click',function(e){        
      alert('button clicked');       
    }, true);
    
    $("input#test")[0].addEventListener("click",function(e){ 
        alert("input clicked"); 
        e.stopPropagation();
    });
}, true);