Why does the setTimeout function execute forever?
<p>I read about the timing event. I am confused about <code>setTimeout</code>: I have an example on W3Schools where it is running every 500 milliseconds. I read about <code>setTimeout</code> that it works only once. <a href="http://www.w3schools.com/js/tryit.asp?filename=tryjs_timing_clock" rel="nofollow">link</a></p>

<pre><code>&lt;head&gt;
  &lt;script&gt;
    function startTime() {
      var today=new Date();
      var h=today.getHours();
      var m=today.getMinutes();
      var s=today.getSeconds();
      document.getElementById('txt').innerHTML=h+":"+m+":"+s;
      setTimeout(function(){startTime()},500);
    }
  &lt;/script&gt;
&lt;/head&gt;
&lt;body onload="startTime()"&gt;
  &lt;div id="txt"&gt;&lt;/div&gt;
&lt;/body&gt;
</code></pre>
