JSFiddle - React, Tailwind, and code Playground
HTML
<input id="input1" type="checkbox"/>
<input id="input2" type="checkbox"/>
JavaScript
$('body').on('click', 'input', function() {
console.log('on',$(this).attr('id'), $(this).prop('checked'));
});
$('#input1').click(function(){
console.log('click',$(this).attr('id'), $(this).prop('checked'));
});
$('#input2').click(function(){
console.log('click',$(this).attr('id'), $(this).prop('checked'));
});
$('#input1').click();
console.log('Now click on second checkbox and you will get [true]');