josh81790
08-10-2004, 01:20 AM
I made a dynamic clock but it only works inside a textbox.
<html>
<body>The Time Is<form name="myclock">
<input type="text" name="thebox" size="40" maxlength="256">
</form></body><head><script type="text/javascript">
function joshfunction(){
var joshdate=new Date()
hour=joshdate.getHours()
minutes=joshdate.getMinutes()
seconds=joshdate.getSeconds()
var hello
if((hour>12)){
hour=hour-12
hello="P.M."
}
else
{
hello="A.M."
}
if((hour==0))hour=12
if((minutes<9))minutes="0"+minutes
if((seconds<9))seconds="0"+seconds
document.myclock.thebox.value=(hour+":"+minutes+" and "+seconds+' seconds '+hello)
}
</script></head><body onLoad="setInterval('joshfunction()',1000)"></body></html>
How can i make that clock update using css without it being in a textbox? :confused:
<html>
<body>The Time Is<form name="myclock">
<input type="text" name="thebox" size="40" maxlength="256">
</form></body><head><script type="text/javascript">
function joshfunction(){
var joshdate=new Date()
hour=joshdate.getHours()
minutes=joshdate.getMinutes()
seconds=joshdate.getSeconds()
var hello
if((hour>12)){
hour=hour-12
hello="P.M."
}
else
{
hello="A.M."
}
if((hour==0))hour=12
if((minutes<9))minutes="0"+minutes
if((seconds<9))seconds="0"+seconds
document.myclock.thebox.value=(hour+":"+minutes+" and "+seconds+' seconds '+hello)
}
</script></head><body onLoad="setInterval('joshfunction()',1000)"></body></html>
How can i make that clock update using css without it being in a textbox? :confused: