JSFiddle - React, Tailwind, and code Playground

by kodjoe mambi

HTML

<span id="counter" onmouseover="maximum(this)">000</span>

JavaScript

$(function ()
{
    var $counter = $('#counter'),
        startVal = $counter.text(),
        currentVal,
        endVal = 652,
        prefix = 'kal/',
        fontSize = $counter.css('font-size');
    
    $start.click(function ()
    {
        this.disabled = true;
        currentVal = startVal;
        var i = setInterval(function ()
        {
            if (currentVal === endVal)
            {
                clearInterval(i);
                reset.disabled = false;
                $counter.animate({});
            }
            else
            {
                currentVal++;
                $counter.text(prefix+currentVal).animate({}, 100);
            }
        }, 100);
    });
    
    $reset.click(function ()
    {
        $counter.text(prefix + startVal);
        this.disabled = true;
        start.disabled = false;
    }).click();
});