JSFiddle - React, Tailwind, and code Playground
by wirey00
HTML
<button class='toggle1'>click</button>
<div class='panel1'></div>
CSS
.panel1 {
height: 100px;
width: 100px;
background-color: red;
}
JavaScript
$('.toggle1').click(function () {
console.log(this);
var panel = $('.panel1');
var curH = panel.height();
panel.animate({
height: curH == 20 ? 100 : 20
}, 1000);
});