Set div to hidden, then visible after time delay
问题 I'm trying to have a yellow square appear on a black background after X amount of time (perhaps even after a random amount of time, but for now let's just do fixed time). function initialSetup() { if (document.getElementById("yellow") != null) { document.getElementById('yellow').style.visibility = 'hidden'; setTimeout("document.getElementById('yellow').style.visibility = 'visible'", 2000); } .box { width: 50px; height: 50px; } .yellow { background: yellow; position: absolute; top: 50%; left: