title: How to kill setInterval() function in JavaScript
body: <p>I have this finction:</p>
  
  <pre><code> var msec = 100;
     setInterval(function () {
              if (childNodeDocument.readyState == "complete") {
                  parent.parent.mapFrame.hideModal;
                  alert("complete");
                  clearInterval();
              }
          }, msec);
  </code></pre>
  
  <p>when this condition is satisfied:</p>
  
  <pre><code>childNodeDocument.readyState == "complete"
  </code></pre>
  
  <p>I want to stop executing setInterval().</p>
  
  <p>But the way I am doing above not working.</p>
  
  <p>Any idea what I am missing? </p>