The script below will provide you A clock in Javascript:
Code:
<html>
<head>
<script type="text/javascript">
function time()
{
var now=new Date();
var hr=now.getHours();
var minute=now.getMinutes();
var s=now.getSeconds();
minute=checkTime(minute);
seconds=checkTime(seconds);
document.getElementById('txt').innerHTML=h+":"+minute+":"+seconds;
t=setTimeout('time()',500);
}
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}
</script>
</head>
<body onload="time()">
<div id="txt"></div>
</body>
</html>
Bookmarks