JSFiddle - React, Tailwind, and code Playground
HTML
<body onload='timer=setInterval("countUP()", 1000 );'>
<div id="timer_container">0</div>
</body>
CSS
#digital {
font-size: 40px;
text-align: center;
top: -200px;
}
JavaScript
var counter = 0
var timer;
function countUP () {
counter = counter + 1;//increment the counter by 1
//display the new value in the div
document.getElementById("timer_container").innerHTML = counter;
}