慕粉4296528
2017-02-25 22:09
<!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>
函数numCount()在“setTimeout("numCount()",1000);”这行代码中调用了自身
JavaScript进阶篇
468194 学习 · 21891 问题
相似问题