JSFiddle - React, Tailwind, and code Playground
HTML
<div class="wrapper">
hello
</div>
<input type="button" id="animate" value="animate"/>
<input type="button" id="button" value="do something"/>
CSS
.wrapper{
width:100px;height:30px;position:relative;
}
JavaScript
$('#animate').click(function(){
$(".wrapper").animate({ left: '+=50'},3000);
});
$('#button').click(function(){
if( $('.wrapper:animated').length>0)
{
$(".wrapper").text("animating") ;
}
if(
$('.wrapper:animated').length<1) {
$(".wrapper").text("not animating") ;
}
})