title: javascript count number
body: <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  var c=0;
  var t;
  var timer_is_on=0;
  
  function timedCount()
  {
  document.getElementById('txt').value=c;
  c=c+1;
  t=setTimeout("timedCount()",30);
  }
  
  function doTimer()
  {
  if (!timer_is_on)
    {
    timer_is_on=1;
    timedCount();
    }
  }
  &lt;/script&gt; 
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;form&gt;
  &lt;input type="button" value="Start count!" onClick="doTimer()"&gt;
  &lt;input type="text" id="txt"&gt;
  &lt;/form&gt;
  &lt;p&gt;Click on the button above. The input field will count forever, starting at 0.&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>How can I modify this code to let it stop at 100?
  Thanks!</p>