JSFiddle - React, Tailwind, and code Playground

by lukempeters

HTML

<div class="counter"></div>

JavaScript

function updateCounter(theNumber) {
    
    var i = 0;
    
    setInterval(function() {
        if(i <= theNumber){
            $('.counter').text(i);
            i += 50;
        }
    }, 30);
    
    
}

    
updateCounter('1500');