JSFiddle - React, Tailwind, and code Playground

by juzerali

HTML

<input type="button" value="hide"/>

<div id="b" ><h1><strong><b>This is shownThis is shownThis is shownThis is shownThis is shownThis is shownThis is shownThis is shownThis is shownThis is shownThis is shownThis is shownThis is shown</b></strong></h1></div>
<div id="a" class='hidden'><h6><small>Hidden</small></h6></div>

CSS

.hidden{
    display : none
}

JavaScript

var shown = true;
$(function() {
    $("input").click(function(e) {
        shown = !shown;
        $(this).val(shown ? "Hide" : "Show");
        $('div').toggleClass("hidden");
    });
});