DIR : /home/kozerus/public_html/ko/clock2.htm
/home/kozerus/public_html/ko
<html>
<body bgcolor=linen onload="startup_clock2()">
<div id=div_clock2>
<h2>clock2</h2>
<div id="txt"></div>
<script id=script_clock2>
function startup_clock2() {
const today = new Date();
let h = today.getHours();
let m = today.getMinutes();
let s = today.getSeconds();
m = checkTime(m);
s = checkTime(s);
document.getElementById('txt').innerHTML = h + ":" + m + ":" + s;
setTimeout(startup_clock2, 1000);
}
function checkTime(i) {
if (i < 10) {i = "0" + i}; // add zero in front of numbers < 10
return i;
}
</script id=script_clock2_end>
</div id=div_clock2_end>
</body>
</html>
//