JSFiddle - React, Tailwind, and code Playground

by Alon Rotem

HTML

<div id="res"></div>

JavaScript

var from = 0;
var to = 50;
var counter = from;

var timer = window.setInterval(function() {
    $("#res").html(counter);
    counter++;
    if(counter == to)
        window.clearInterval(timer);
}, 500);