代码如下:
<script language=javascript>
var enabled=0;
function tofunc() {
to = window.settimeout( tofunc(), 1000);
var today = new date();
document.clock.disp.value = today.tolocalestring();
}
</script>
<form name=clock>
<input type=text name=disp value= size=20
onfocus=this.blur() ><br>
<input type=radio name=rad value=off onclick=if( enabled==1 )
{
document.clock.disp.value='';
cleartimeout( to );
enabled = 0;
}
checked>关<font color=#ffff99> </font>
<input type=radio name=rad value=on onclick=if( enabled == 0 )
{
var to = settimeout( 'tofunc()', 1000 );
enabled = 1; } >开<font color=#ffff99> </font>
</form>
插入到网页中看看