JSFiddle - React, Tailwind, and code Playground

by Alfie

HTML

<div Style="selected" >
    <input type='checkbox' id='check'/>
</div>

CSS

div{
    background:red;
    width:100px;
height:100px;
}
.selected{
  background:blue!important;
  height:50px;
  width:50px;
}

JavaScript

$('input').on('change',function(){
 $(this).parent().toggleClass('selected');
 })