JSFiddle - React, Tailwind, and code Playground

HTML

<button class="clickme">Click Me</button>

<button class="disablebar">Disable "barevent"</button>

<h4>Log</h4>
<ul>
    
</ul>

JavaScript

$(function(){
   
    $(".clickme").on("click.barevent", function(e){
       log("bar");
    });
    
    $(".clickme").on("click.bazevent", function(e){
       log("baz");
    });    
    
    $(".disablebar").click(function(e){
       $(".clickme").off("click.barevent"); 
       log("Disabled bar");
    });
    
    
});

function log(msg){
    var $li = $("<li/>").text(new Date() + " - " + msg);
    $("ul").append($li);
}