JSFiddle - React, Tailwind, and code Playground

HTML

<p id="display_area"></p>

JavaScript

window.onload = function() {
    var da = document.getElementById("display_area");

    function setClockDisplay() {
        var time = new Date();
        var hour = time.getHours();
        var minute = time.getMinutes();
        var second = time.getSeconds();

        var currentTime = hour + ":" + minute + ":" + second;

        da.innerHTML = currentTime;
    }

    setInterval(setClockDisplay, 1000);
}