JSFiddle - React, Tailwind, and code Playground

by dfsq

HTML

<button class="show">Show</button>
<button class="test hide transparent">Hide</button>

CSS

.test {
    -webkit-transition: opacity 1s ease;
}
.hide {
    height: 0;
    width: 0;
}
.transparent {
    opacity: 0;
}

JavaScript

$(function() {
    var test = $(".test");
    var show = $(".show");
    
    test.on("click", function() {
        test.addClass("hide transparent");
    });
    
    show.on("click", function() {
        test.removeClass("hide transparent");
    });
});