title: How to count 0 to 10 with setInterval
body: <p>I wrote a simple code to count and display number that count in loop.
  <br>but it doesn't work. :(</p>
  
  <p>pls show me my problem.</p>
  
  <p>TnX </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript" src="jquery-1.9.1.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          $(document).ready(function (){
              function myCount() {
                  var count = 0;
                  if (count == 0) {
                      count += 1;  
                  } else if (count &gt; 10) {
                      count = 0;
                  }
                  $('.count').text(count);
              }
              setInterval(myCount(),200);
          });        
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;p&gt;Count form 0 to 10: &lt;span class="count"&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>