JSFiddle - React, Tailwind, and code Playground

by pgrillot

HTML

<div id="div2">
</div>
<div id="div1">
</div>

CSS

#div1{
    height:100px;
    width:100px;
    background-color:red;
    display:none;
    position:absolute;
}

#div2{
    height:100px;
    width:100px;
    background-color:blue;
    position:absolute;
}

JavaScript

$('#div1').fadeIn();

setTimeout(function(){
    $('#div1').fadeOut(600)
      
},4000);