title: HTML/JavaScript: Timer/Stopwatch doesn't reset (after stop)
body: <pre><code>&lt;html&gt;
      &lt;head&gt;
      &lt;script language="JavaScript"&gt;
  var c1 = 0;
  var c2 = 0;
  var c3 = 0;
  var o1 = 0;
  var o2 = 0;
  var o3 = 0;
  ID = window.setTimeout("start();", 100);
  
  function start() {
      if (c1 == 59) {
          c1 = 00;;
          if (c2 == 59) {
              c2 = 00;
          }
          else c2++;
      }
      else c1++;
  
      if (c1 == 0 || c1 == 1 || c1 == 2 || c1 == 3 || c1 == 4 || c1 == 5 || c1 == 6 || c1 == 7 || c1 == 8 || c1 == 9) o1 = "0" + c1;
      else o1 = c1;
      if (c2 == 0 || c2 == 1 || c2 == 2 || c2 == 3 || c2 == 4 || c2 == 5 || c2 == 6 || c2 == 7 || c2 == 8 || c2 == 9) o2 = "0" + c2;
      else o2 = c2;
      if (c3 == 0 || c3 == 1 || c3 == 2 || c3 == 3 || c3 == 4 || c3 == 5 || c3 == 6 || c3 == 7 || c3 == 8 || c3 == 9) o3 = "0" + c3;
      else o3 = c3;
  
      document.forms[0].elements[0].value = o3 + ":" + o2 + ":" + o1;
      ID = window.setTimeout("start();", 100);
  }​
  &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form name="frm1"&gt;
              &lt;input type="text" name="timer1"&gt;
              &lt;input type="button" name="but1" value="start" onClick="c1=0; c2=0; c3=0; o1=0; o2=0; 
  
  o3=0; start();"&gt;
              &lt;input type=button name="but2" value="stop" onClick="window.clearTimeout(ID);"&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;​
  </code></pre>
  
  <p><a href="http://jsfiddle.net/B4a54/" rel="nofollow">Live demo here</a>.</p>
  
  <p>Status Bar gives the error: Object doesn't support this action.</p>