JSFiddle - React, Tailwind, and code Playground

by vishal pandey

HTML

<div id="unhide"  style="display:none;">DUMMY TEXT</div>

<button id="expand" name="expand">Show The Div</button>

JavaScript

document.getElementById("expand").addEventListener("click", function() 
    {
        if(document.getElementById('unhide').style.display == 'block')
              document.getElementById('unhide').style.display = 'none';
           else
              document.getElementById('unhide').style.display = 'block';
    });