JSFiddle - React, Tailwind, and code Playground

by slashingweapon

HTML

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

JavaScript

var max = 2;

function incCounter() {
    var currCount = parseFloat($('.counter').html());
    currCount += .01;
    $('.counter').text( currCount.toFixed(2) );
    if (currCount < max)
        setTimeout(incCounter,50);
}
incCounter();