title: Javascript Timed Message
body: <p>I'm trying to make a timed alert that goes off at midnight, and the code so far:</p>
  
  <pre><code>function startTime() {
      var today=new Date();
      var h=today.getHours();
      var m=today.getMinutes();
      var s=today.getSeconds();
      h = checkTime(h);
      m = checkTime(m);
      s = checkTime(s);
  
      var t = setTimeout(function(){startTime()},1000);
  
      if (h==0&amp;&amp;m==0&amp;&amp;s==0){window.alert("The date is "+new Date()); location.reload();}
  }
  </code></pre>
  
  <p>goes off at every hour, not every 24 hours like it should. I also could not find where the bug is because it all looks like it should work. Can you please help me?</p>