JSFiddle - React, Tailwind, and code Playground

by merindema

HTML

<h2 id='vivod_22'></h2>

JavaScript

window.onload = function() {
    var vivodTime  = document.getElementById('vivod_22');

    var day = setInterval(function(){
        var current = new Date();
        vivodTime.innerHTML = 'Сегодня' + ' ' + current;
        if(current.getHours < 12) {
            document.body.style.backgroundColor = 'yellow';
        } 
        else {
            document.body.style.backgroundColor = 'pink';
        }
    }, 1000);
}