JSFiddle - React, Tailwind, and code Playground
by TwistedEinstein
HTML
<div id="extra">This is could be a hidden form</div>
<input type="checkbox" id="checkme" />
<label>Click me</label>
JavaScript
$(document).ready(function () {
//Hide div w/id extra
$("#extra").css("display", "none");
// Add onclick handler to checkbox w/id checkme
$("#checkme").click(function () {
// If checked
if ($("#checkme").is(":checked")) {
//show the hidden div
$("#extra").show("fast");
} else {
//otherwise, hide it
$("#extra").hide("fast");
}
});
});