案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript">
4
function timedText()
5
{
6
var t1=setTimeout("document.getElementById('txt').value='2 seconds!'",2000)
7
var t2=setTimeout("document.getElementById('txt').value='4 seconds!'",4000)
8
var t3=setTimeout("document.getElementById('txt').value='6 seconds!'",6000)
9
}
10
</script>
11
</head>
12
13
<body>
14
<form>
15
<input type="button" value="显示计时的文本!" onClick="timedText()">
16
<input type="text" id="txt">
17
</form>
18
<p>在按钮上面点击。输入框会显示出已经流逝的 2、4、6 秒钟。</p>
19
</body>
20
21
</html>
22