JSFiddle - React, Tailwind, and code Playground

by Mike Gleeson

HTML

<div>
<label>Test
    <span></span>
    <span class='ui-checkbox '>&nbsp;</span>
</label>
<input id='test' type='checkbox'/>
</div>

CSS

.ui-checkbox 
{
    background-color:red;
}

.test .ui-checkbox  {
    background-color: blue;
}

JavaScript

$("#test").change(function(){
    var _this = $(this);
    _this.siblings().toggleClass("test");
});