qq_曾婷红
2018-05-07 12:07
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">
var num=0;
function numCount(){
document.getElementById('txt').value=num;
num=num+1;
setInterval("numCount()",1000);
}
</script>
</head>
<body>
<form>
<input type="text" id="txt" />
<input type="button" value="Start" onClick="numCount()" />
</form>
</body>
</html>
因为函数numCount()调用了自己
JavaScript进阶篇
468060 学习 · 21891 问题
相似问题