JSFiddle - React, Tailwind, and code Playground

by lasha

HTML

<div id="count">1</div>
<button id="start">Go</button>

JavaScript

$(function() {
    var endValue = 10000,
        currentValue = $('#count').text();
    
    $('#start').click(function() {
        var interval = setInterval(function() {
            if (currentValue === endValue) {
                clearInterval(interval);
            }
            else {
                currentValue++;
                $('#count').text(currentValue);
            }
        }, 10);
    });
});