SpiritualStorms
08-10-2004, 05:44 AM
I have the following script:
function liveclock() {
var curdate = new Date();
var hours=curdate.getHours();
var minutes=curdate.getMinutes();
var seconds=curdate.getSeconds();
var suffix="AM"
var box=document.tee_One.tee_Two;
if (hours>=12){
suffix="PM";
if (hours>=13)
hours-=12
}
if (minutes<10)
minutes= "0" + minutes;
if (seconds<10)
seconds= "0" + seconds;
var thetime = hours+ ":" +minutes + ":" + seconds + " " +suffix;
box.value = thetime;
setTimeout("liveclock()",1000)
}
liveclock();
The thing is, nothing is displayed in the content box. And i get no errors.
function liveclock() {
var curdate = new Date();
var hours=curdate.getHours();
var minutes=curdate.getMinutes();
var seconds=curdate.getSeconds();
var suffix="AM"
var box=document.tee_One.tee_Two;
if (hours>=12){
suffix="PM";
if (hours>=13)
hours-=12
}
if (minutes<10)
minutes= "0" + minutes;
if (seconds<10)
seconds= "0" + seconds;
var thetime = hours+ ":" +minutes + ":" + seconds + " " +suffix;
box.value = thetime;
setTimeout("liveclock()",1000)
}
liveclock();
The thing is, nothing is displayed in the content box. And i get no errors.