JSFiddle - React, Tailwind, and code Playground

by heriberto perez

HTML

<div class="ui-checkbox">
          <input type="checkbox" name="checkbox-1b" id="checkbox-1b" class="custom">
          <label for="checkbox-1b" data-corners="true" data-shadow="false" data-iconshadow="true" data-wrapperels="span" data-icon="checkbox-off" data-theme="c" data-mini="false" class="ui-checkbox-off ui-btn ui-btn-corner-all ui-fullsize ui-btn-icon-left ui-first-child ui-btn-up-c">
            <span class="ui-btn-inner">
              <span class="ui-btn-text">Cheetos</span>
              <span class="ui-icon ui-icon-checkbox-off ui-icon-shadow">&nbsp;</span>
            </span>
          </label>
        </div>

JavaScript

$(function () {
  alert($('#checkbox-1b').is(':checked'));
  $('#checkbox-1b').prop('checked', true);
  alert($('#checkbox-1b').is(':checked'));
  $('#checkbox-1b').removeAttr('checked');
  alert($('#checkbox-1b').is(':checked'));
  $('#checkbox-1b').prop('checked', true);
  alert($('#checkbox-1b').is(':checked'));
  $('#checkbox-1b').removeAttr('checked');
  alert($('#checkbox-1b').is(':checked'));
});