JSFiddle - React, Tailwind, and code Playground
HTML
<div id="ahoj"> </div>
<button id="kk"> ahoj </button>
CSS
#ahoj
{width:100px;
height:50px;
background-color:red;}
JavaScript
function sg()
{var x = document.getElementById("ahoj");
var g = x.style.display;
if(g=="none")
{x.style.display="block"}
else
{x.style.display="none"};}
window.onload=ok;
function ok()
{document.getElementById("kk").onclick=sg;}