JSFiddle - React, Tailwind, and code Playground
by Mohit Kumar Gupta
HTML
<a id="button" href="#">click</a>
<br><br>
<a id="toggle" href="#">unbind</a>
JavaScript
$(document).on('click', 'a#button', function(){
$(this).after('<span> hello</span>');
$('span').fadeOut(1000);
});
//$('a#button').on('click', function(){alert('always fires');});
$('a#toggle').toggle(
function(){
$(this).text('rebind');
$('a#button').on('click.disabled', false);
},
function(){
$(this).text('unbind');
$('a#button').off('click.disabled');
}
);