JSFiddle - React, Tailwind, and code Playground

by asou ryouma

HTML

<p><span id="counter">0</span></p>

JavaScript

$(function() {
    var current = $('#counter').text();
    // 0からスタートしてセットした値までカウントアップさせる
    $({count: 2500}).animate({count: current}, {
        duration: 5000,
        easing: 'linear',
        progress: function() { 
            $('#counter').text(Math.ceil(this.count)); 
        }
    });
});