title: Use of setInterval on javaScript
body: <p>As always, I would appreciate very much if somebody out there could help me a little bit with this code.</p>
  
  <p>I have the following lines of code:</p>
  
  <pre><code>var count = 0;
  var limit = 2000;
  function liveCount(){
      var increment = count + 10;
      count = increment;
      if(count &lt;= limit){
          document.getElementById('showCount').textContent=count;
      }else{
          clearInterval();
      }
  }
  var counter = setInterval('liveCount()', 10);
  </code></pre>
  
  <p>What this code does is simulate a counter from 0 to X as a chronometer would do. 
  It works perfect when I use it stand-alone, it starts counting and updates the count in 10 miliseconds intervals until it reaches the limit and then it stops.<br>
  So far so good.<br>
  My problem is that when I nest this code inside another function, which is the one that will provide the value for the "count and limit" variables, I get an error saying that the "liveCount()" is not defined, refering to the parameter of the "setInterval()".   </p>
  
  <p>I have tried everything I can think of and I cant get it to work.<br>
  Any ideas what am I missing or doing wrong?   </p>
  
  <p>Thank you all.</p>