关于计时器setTimeout()的问题
setTimeout()计时器的定义是,在载入后延迟指定时间后,区执行一次表达式,仅此一次,
为什么下边的代码可以反复执行,麻烦详细讲解下!不胜感谢!
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">
var num=0;
function numCount(){
document.getElementById('txt').value=num;
num=num+1;
setTimeout("numCount()",1000);
}
</script>
</head>
<body>
<form>
<input type="text" id="txt" />
<input type="button" value="Start" onClick="numCount()" />
</form>
</body>
</html>