title: How can I increment a number after every 1 second using javascript?
body: <p>Everything is working but i m unable to set the delay. Also , I will like to stop the increment after a particular interval. kindly please help me</p>
  
  <p>Javascript:</p>
  
  <pre><code>$(document).ready(function() {
      var number = parseInt($('#test').text().trim());
      while (number != 1000) {
          number++;
          $("#test").text(number);
          var number = parseInt($('#test').text().trim());
      }
  });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;p id="test"&gt;1&lt;/p&gt;
  </code></pre>