title: Javascript setInterval every 5 seconds
body: <p>I would like to set an interval of 5 seconds between each alert. Found this <a href="https://stackoverflow.com/questions/4653203/in-jquery-how-do-i-create-alert-every-5-seconds">thread</a>:</p>
  
  <pre><code>setInterval(function() {
      alert("Message to alert every 5 seconds");
  }, 5000);
  </code></pre>
  
  <p>But where do I put the <code>setInterval()</code> in order to alert every 5 seconds?</p>
  
  <pre><code>$(window).scroll(function() {
      if (checkVisible($('#footer'))) {
          alert("I DONT SEE A FOOTER");
      } else {
          alert("EUREKA - I SEE A FOOTER");
      }
  });
  
  function checkVisible(elm, eval) {
      eval = eval || "visible";
      var vpH = $(window).height(), // Viewport Height
          st = $(window).scrollTop(), // Scroll Top
          y = $(elm).offset().top,
          elementHeight = $(elm).height();
  
      if (eval == "visible") 
          return ((y &lt; (vpH + st)) &amp;&amp; (y &gt; (st - elementHeight)));
  
      if (eval == "above") 
          return ((y &lt; (vpH + st)));
  }
  </code></pre>
  
  <p>Many thanks in advance.</p>