title: Animation on a integer value type in javascript creating an issue?
body: <p>There are 2 functions below- myCalculator() function which holds the variable with static value and animateValue() function will animate that value from <strong><code>var start to end</code></strong>.(defined var in 1st func.) But the issue is that the value is not animating on form button click</p>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;form id="contact" action="" method="post"&gt;
      &lt;fieldset&gt;
       &lt;font class="label"&gt;How many people do you want to save per month? &lt;/font&gt;  &lt;input placeholder="" id="active-member" type="text" style="width:110px;float: right;"/&gt;
      &lt;/fieldset&gt;
     &lt;fieldset&gt;
      &lt;button name="submit" type="button" id="contact-submit" onclick="myCalculator();" style="float: right;"&gt;Calculate&lt;/button&gt;
      &lt;/fieldset&gt;
  
     &lt;/form&gt;
  
    &lt;div class="container2" style="display:none;"&gt;
     Animating Value &lt;span id="value" &gt;&lt;/span&gt;
     &lt;/div&gt;
  
    &lt;script&gt;
    function myCalculator() {
  
      $(".container2").show();
      var start = 1000;
      var end = 23600191;
      animateValue("value", start, end, 1000);
      }
  
      function animateValue(id, start, end, duration) {
      var range = end - start;
      var current = start;
      var increment = end &gt; start? 1 : -1;
      var stepTime = Math.abs(Math.floor(duration / range));
      var obj = document.getElementById(id);
      var timer = setInterval(function() {
          current += increment;
          obj.innerHTML = current;
          if (current == end) {
              clearInterval(timer);
          }
       }, stepTime);
        }
  
      &lt;/script&gt;
  </code></pre>
  
  <p><strong>Note:</strong></p>
  
  <ol>
  <li>animateValue function is not taking the value of <strong><code>var start and end</code></strong></li>
  <li>2000 is 2 second</li>
  <li>myCalculate function calculating some values</li>
  <li>animateValue function will animating the value</li>
  </ol>