JSFiddle - React, Tailwind, and code Playground

HTML

<label>
    <input type="checkbox" class="bike"/>
    <span>I have a bike</span></label>
<label> 
    <input type="checkbox" checked class="car"/>
    <span>I have a car</span>
</label>
<button>Click</button>

CSS

input[type=checkbox]+span{
   color:red;
 }
 input[type=checkbox][checked]+span{
    color:green;
 }

JavaScript

$('button').click(function(){
    $('.bike').attr('checked',true);
});