JSFiddle - React, Tailwind, and code Playground
by rixlabs
HTML
<p id="myP">This is a p element.</p>
<button type="button" onclick="myFunction()">Hide content of p</button>
JavaScript
function myFunction() {
var which= document.getElementById("myP");
if (which.style.display =="block" || which.style.display =="")
which.style.display = "none"
else
which.style.display = "block"
}