Inauguriamo anche questa sezione, provate questo semplice cod:
<html>
<head>
<TITLE>Dynamic HTML - dimostrazione pratica </TITLE>
<SCRIPT LANGUAGE="JavaScript" ID="code">
var MS=navigator.appVersion.indexOf("MSIE")
window.isIE4 = (MS>0) && (parseInt(navigator.appVersion) >= 4)
function lead0(val) {
return val<10 ? "0"+val.toString() : val
}
function buildTime() {
var time = new Date()
var h=time.getHours()
if (h > 24) {h = h - 24;}
return h+":"+lead0(time.getMinutes())+":"+ lead0(time.getSeconds())
}
function tick() {
document.all.clock.innerText = buildTime()
}
window.onload = new Function("if (window.isIE4) setInterval('tick()',1000)")
</SCRIPT>
</HEAD>
<font size=5 face=verdana color="#FF0000" ><b>
<SPAN ID=clock>
<SCRIPT Language=Javascript>
document.write(buildTime())
</SCRIPT>
</SPAN>
</b></font>
</BODY>
</HTML>