JSFiddle - React, Tailwind, and code Playground
HTML
<div id="div1">
</div>
<div id="div2">
</div>
CSS
#div1{
height:100px;
width:100px;
background-color:red;
display:none;
}
#div2{
height:100px;
width:100px;
background-color:blue;
display:none;
}
JavaScript
$('#div1').fadeIn();
setTimeout(function(){
$('#div1').fadeToggle(600,function() {
$('#div2').fadeToggle(0);
});
},4000);