JSFiddle - React, Tailwind, and code Playground

HTML

<h2>This is a heading</h2>

<p id="test">This is a paragraph.</p>
<p id="test">This is another paragraph.</p>

 <input type="checkbox" id="s">Click me

JavaScript

$(document).ready(function(){
$('#s').change(function(){
if(this.checked)
    $("#test").hide();  // checked
else
    $("#test").show();
		});
});