JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css">
<input type="checkbox" id="cb1"/><label for="cb1">std toggle button</label>
<input type="checkbox" id="cb2"/><label for="cb2" id="lbl" class="unselectable">fixed toggle button</label>

CSS

.unselectable {
   -moz-user-select: -moz-none;
   
   -webkit-user-select: none;
   user-select: none;   
}

.ui-button { margin: 10px;}

JavaScript

$('#cb1, #cb2').button();

$('#lbl').click(function() {
    var $chk = $("#" + $(this).attr("for"));
    $chk[0].checked = !$chk[0].checked;
    $chk.button("refresh");
    $chk.change();
    return false;
});