JSFiddle - React, Tailwind, and code Playground

by kralco626

HTML

<script src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script>
<input type="checkbox" checked="checked" id="Activechk" /><label for="Activechk">Active</label>

JavaScript

$("#Activechk").button();
        var activechk = $("#Activechk");
        activechk.click(function() {
            if (this.checked) {
                $(this).button("option", "icons", { primary: 'ui-icon-check' });
            } else {
                $(this).button("option", "icons", { primary: 'ui-icon-cancel' });
            }
        });
        if ($("#Activechk").checked) {
            $("#Activechk").button("option", "icons", { primary: 'ui-icon-check' });
        } else {
            $("#Activechk").button("option", "icons", { primary: 'ui-icon-cancel' });
        }