JSFiddle - React, Tailwind, and code Playground
HTML
<button id="timeIt">Start Timer</button>
<div id="time"></div>
JavaScript
function go() {
var time = document.getElementById('time'),
timeIt = document.getElementById('timeIt'),
interval, count = 30;
clearInterval(interval);
interval = setInterval(hola, 500);
function hola(){
time.innerHTML = --count;
}
}
go();