JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" value="Show/Hide" onclick="hideshow();" />
<div id="text">Some text</div>

CSS

#text {
 display: block;   
}

JavaScript

function hideshow() {
    var showhide = document.getElementById('text').style;
(showhide.display = showhide.display == "none" ?  "block" : "none" )

}