<div>
Утеряны ключи от сторожки <span class="lost">Пропажа</span>
</div>
<div>
Найден гном <span class="found">Находка</span>
</div>
.lost{
background-color: #ff0000;
padding: 2px 2px;
border-radius: 5px
}
.found{
background-color: #65c178;
padding: 2px 2px;
border-radius: 5px
}
<div> Current Time
<span id="clock"></span>
</div>
window.onload = function(){
function showClock(){
var time = new Date();
var hour = time.getHours();
var minute = time.getMinutes();
var sec = time.getSeconds();
var timeFormatter = digitFormatter(hour)+':'+digitFormatter(minute)+':'+digitFormatter(sec);
var clock = document.getElementById("clock");
clock.textContent = timeFormatter;
}
function digitFormatter(num){
if(num<10){
return '0'+num;
}else{
return num;
}
}
showClock();
setInterval(showClock,1000)
}