JSFiddle - React, Tailwind, and code Playground
HTML
<div class = "animation">
</div>
<button id = "change"> Click </button>
CSS
.blue{
background-color: blue;
}
.red {
background-color: red;
}
.animation{
background-color: white;
width: 100px;
height: 100px;
border: 1px solid black;
}
JavaScript
$(document).ready(function(){
$("#change").click(function(){
$(".animation").css("background", "blue").delay(700).css("background", "red");
});
});