JSFiddle - React, Tailwind, and code Playground

HTML

<div>A sample div</div>

<input type="checkbox" name="checkbox" id="checker"/><label for="checkbox">Some checkbox</label><br/>
<input type="radio" name="radio" value="enable"/>Enable green!<br/>

CSS

div {background-color: gray; width: 200px; height: 200px}

JavaScript

var theDiv = $('div');
$('input').change(function() {
    if (this.checked) {
        theDiv.css('background-color', 'lime');
    } else {
        theDiv.css('background-color', 'gray');
    }
});