JSFiddle - React, Tailwind, and code Playground

HTML

<p>
<span id="hour"></span> : <span id="mins"></span> : <span id="secs"></span>
</p>

JavaScript

function clock(){
var date=new Date();
console.log(date);
console.count("called");
var hours=date.getHours();
var min=date.getMinutes();
var sec=date.getSeconds();

document.getElementById('hour').innerText=hours;
document.getElementById('mins').innerText="0"+min;
document.getElementById('secs').innerText=sec;


}
clock();
setInterval(clock,1000);