JSFiddle - React, Tailwind, and code Playground
HTML
<input type="checkbox" id="1">
<input type="button" id="2" value="click">
JavaScript
$(document).on("click","#2",function()
{
if($("#1").is(":checked") == true)
{
$("#1").prop('checked', false);
}
else
{
$("#1").prop('checked', true);
}
$('#1').trigger('change');
})
$("#1").change(function()
{
alert("changed")
})