JSFiddle - React, Tailwind, and code Playground
HTML
<input type = "checkbox" id = "check" />
<input type = "button" id = "buttonId" value="toggle checkbox" />
JavaScript
$("#buttonId").click( function() {
var checkbox = $("#check")[0];
checkbox.checked = !checkbox.checked; // invert its checked status
});