title: Reveal a div after x seconds, and reveal another div after y seconds
body: <p>I am very new to this, but I'm attempting to reveal div1 after 1 second, and reveal div2 after 5 seconds. At the moment, only div2 is displaying after 1 second. Please help me fix the javascript.</p>
  
  <p>I'd also like to know how to hide div1 after div2 is displayed.</p>
  
  <p>My code: </p>
  
  <pre><code>&lt;div id="div1" style="visibility: hidden"&gt;Reveal Div 1 after 1 second&lt;/div&gt;
  &lt;div id="div2" style="visibility: hidden"&gt;Reveal Div 2 after 5 seconds&lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  function showIt() {
    document.getElementById("div1").style.visibility = "visible";
  }
  setTimeout("showIt()", 1000); // after 1 sec
  
  function showIt() {
    document.getElementById("div2").style.visibility = "visible";
  }
  setTimeout("showIt()", 5000); // after 5 secs
  &lt;/script&gt;
  </code></pre>