Stap 10: Voeg een klok.
[code]
< tabelrand = 2 >
< tr >
< td >
< script >
var mydate = nieuwe Date()
var year=mydate.getYear()
Als (jaar < 1000)
jaar += 1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
Als (daym < 10)
daym = "0" + daym
var dayarray = nieuwe Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray = nieuwe Array("January","February","March","April","May","June","July","August","September","October","November","December")
document.write ("< kleine >< tekstkleur = '000000' face ="Arial">< b >" + dayarray [dag] + "," + montharray [maand] + ""+ daym +","+ jaar +"< /b >< / lettertype >< / kleine >")
< / script >
< /td >
< /tr >
< tr >
< td >
< span id = tick2 >
< / span >
< script >
<!--
functie show2() {}
Als (! document.all & &! document.getElementById)
terugkeer
thelement=document.getElementById? document.getElementById("tick2"): document.all.tick2
var digitale = nieuwe Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn = "PM"
Als (uur < 12)
DN = "AM"
Als (uur > 12)
uren = uur-12
Als (uren == 0)
uren = 12
Als (minuten < = 9)
minuten = "0" + minuten
Als (seconden < = 9)
seconds = "0" + seconden
var ctime = uur + ":"+ minuten +":" + seconden + "" + dn
thelement.innerHTML= "< b stijl =' lettertype-grootte: 14; kleur: blauw;' > "+ ctime +"< /b >"
setTimeout("show2()",1000)
}
Window.onload=show2
-->
< / script >
< /td >
< /tr >
< / table >
[/ code]