93、带开关的时钟

93、带开关的时钟

脚本说明:

第一步:把如下代码加入<body>区域中

<script language="JavaScript">

var enabled = 0;

function TOfunc() {

TO = window.setTimeout( "TOfunc()", 1000 );

var today = new Date();

document.forms[0].elements[0].value = today.toString();}

</SCRIPT>

<script language="JavaScript">

function Stopfunc(){

clearTimeout(TO);

var enabled = 0;

}

</SCRIPT>

<FORM>

<input type="text" name="disp" value="" size=25 onFocus="this.blur()"><br>

<input type="radio" name="rad" value="OFF" onClick="Stopfunc();"><b>OFF</b>

<input type="radio" name="rad" value="ON" checked onClick="TOfunc();"><b>ON</b><br>

</form>

 

 

第二步:把<body>中的内容改为:

<body bgcolor="#fef4d9" onload="TOfunc()">

 

Write a comment

Comments: 0