JSFiddle - React, Tailwind, and code Playground
HTML
<span class="checkb"><input id="something" type="checkbox" /></span>
JavaScript
/*$('.checkb :checkbox').change(function(){
if(this.checked){
// Do somethin'
alert(this.id);
} else {
// Do something else
alert('Unchecked!');
}
});*/
$(".checkb").toggle(function() {
var cid = $(this).children(':checkbox').attr('id');
alert(cid);
}, function() {
alert('checkbox unchekced');
});