title: Window location replace - timeout help? Javascript question
body: <p>I have had tried to figure a way to add a timeout in my code before it redirects you.
  I have googled and found some help but none of them are doing what I expected </p>
  
  <blockquote>
    <p>/**** This prompts user what year they were born and calculates age (roughly) */
    /*****If the user is under 18 takes them to Disneyland, if not they are allowed to enter */</p>
  </blockquote>
  
  <p>function ageButton() {
      var askDOB = prompt("What year were you born?");</p>
  
  <pre><code>if (askDOB &gt; 2002) {
      document.getElementById("agePass").innerHTML = "Access Denied"
      window.location.replace("http://www.disney.com");
  }
  else {
      document.getElementById("agePass").innerHTML = "Access Granted"
      window.location.replace("http://www.w3schools.com");
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Just need a way to have a 3 second timeout before it redirects </p>