window.onload=function(){ var image = document.getElementById("test"); setTimeout(() => image.style.display = "block", 5000); setTimeout(() => image.style.display = "none", 7000); }