duoe

<html>
<head>
<title>window.setTimeout()函数</title>
<script laguage="javascript">
<!--
function showtime()
{
mytime=new Date();
mytime=mytime.getHours()+":"+mytime.getMinutes()+":"+mytime.getSeconds();
document.myform.mytext.value=mytime;
window.clearTimeout(mytimeout);
var mytimeout=window.setTimeout("showtime()",1000)
}

//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="myform">
<table border=0 align=center>
<tr>
<td><input type=text name=mytext size=20 style="background-color:lightgreen;color:blue"></td>
<td><input type=button value="设置时间" onclick=window.setTimeout("showtime()",1000) style="background-color:lightblue;"></td>
</tr>
</table>
</form>
</body>
</html>

分类:

技术点:

相关文章:

  • 2021-12-03
  • 2021-12-03
  • 2021-12-04
  • 2021-06-28
  • 2021-12-03
  • 2021-11-13
  • 2021-07-10
猜你喜欢
  • 2021-12-03
  • 2021-12-17
  • 2021-12-03
  • 2021-11-07
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
相关资源
相似解决方案