JSFiddle - React, Tailwind, and code Playground
by jfriend00
HTML
<button id="test">Run</button><button id="reset">Reset</button>
<div id="box"></div>
CSS
#box {
height: 100px;
width: 100px;
position: absolute;
top: 300px;
left: 10px;
background-color: red;
}
JavaScript
$("#test").click(function() {
$("#box").animate({top: '50px', height: 0}, 2000);
});
$("#reset").click(function() {
$("#box").css({top: "350px", height: "100px"});
});