Seeking assistance with a unique coding predicament. I've got an HTML file that showcases a JavaScript-powered clock, but now I'm looking to enhance it by incorporating a looped video beneath the time display. Oddly enough, when the clock feature is active, the video fails to show up; however, everything works as intended once the clock divs are commented out. Can anyone offer guidance on how to troubleshoot this issue? Apologies for the convoluted mix of CSS/HTML/JavaScript.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Javascript Clock</title><script language="JavaScript" type="text/javascript">
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
var day = today.getDate();
var month = today.getMonth() + 1;
var year = today.getFullYear();
var hsec=Math.floor(today.getMilliseconds());
// add a zero in front of numbers<10
document.getElementById('txt').innerHTML=h+":"+checkTime(m)+":"+checkTime(s)+":"+checkHTime(hsec);
document.getElementById('cal').innerHTML=checkTime(month)+"/"+checkTime(day)+"/"+year;
setTimeout('startTime()',10);
}
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}
function checkHTime(i)
{
if (i<100)
{
if (i<10)
{
i="0" + i;
}
i="0" + i;
}
return i;
}
</script></head>
<body onload="startTime()" bgcolor="black">
<center><br><br><br><img style="width: 776px; height: 133px;" alt="ad" src="ad-logo-pms2945% 20png.png"><br><br>
<div id="video">
<video id="duck-movie" height="240">
<source src="duck.mp4" type="video/mp4">
Video is unavailable
</video>
</div>
<div id="txt" style="font-family: serif; font-size: 30pt; font-weight: bold; color: red;">00:00:00:00</div>
<div id="cal" style="font-family: serif; font-size: 30pt; font-weight: bold; color: red;>"00/00/0000</div>
</center>
</body></html>
EDIT: Interestingly, shifting the "video" div above the "txt" and "cal" divs resolves the conflict, enabling both the video playback and proper functioning of the clock.