JSFiddle - React, Tailwind, and code Playground

HTML

<input type=text id="timer">

JavaScript

var tempTimer = 0;
setInterval(function () {
    goTimer()
}, 500);

function goTimer() {
    tempTimer++;
    $("#timer").val(tempTimer);
}