php javascript cleartimeout() not working
<p>I have a setTimeout and clearTimeout where the setTimeout is working fine but clearTimeout is not working, can anyone help me?</p>

<p>code:</p>

<pre><code>&lt;script type="text/javascript"&gt;
  var i = 0;
  var status = setTimeout(function () {
    if (i &lt;= 2) {
      metrics_status();
      i++;
    } else {
      clearTimeout(status);
    };
  }, 3000);
&lt;/script&gt;
&lt;div id="ReloadMetrics"&gt;&lt;/div&gt;
</code></pre>
