JSFiddle - React, Tailwind, and code Playground

by Daniel Lamb

HTML

Toggle block:
<input id="toggle" type="checkbox" />
<div id="example" style="display:none"></div>

CSS

#example {
    width: 100px;
    height: 100px;
    background: red;
}

JavaScript

$('#toggle').on('click', function () {
    if (!this.checked) {
        $('#example').hide();
    } else {
        $('#example').show();
    }
});