Function at JS, need advice
Hi everyone, I have a short program. I want the div fadeout after 3 second, and then re appear. But I just can't make it re apear. Please help. Thanks the html and JS <body> <div id = "outer"> </div> <script> setTimeout(function(){ document.getElementById("outer").className = "fadeout" },3000); setTimeout(function(){ document.getElementById("outer").className = "fadein" },1000); </script> </bod> and the css : #outer{ width: 500px; height: 500px; position: relative; background-color: #FFA500; opacity: 1; } #outer.fadeout{ transition: opacity 2s; opacity: 0; } #outer.fadein{ transition: opacity 1s; opacity: 1; }