JSFiddle - React, Tailwind, and code Playground
by notacouch
HTML
<input type='checkbox' id='try' >try
<button id='click'>Click</button>
JavaScript
$body = $('body');
$body.on('custom', "#try", function(event, data) {
console.log('data?', data);
if (!!data) {
alert('A) not human')
} else {
alert('B) human');
}
});
$body.on('click', '#try', function(event){
$(this).trigger('custom');
});
$body.on('click', '#click', function(event) {
$("#try").trigger('custom', ['data here, or just a bool']);
});