为什么这样会循环 不是说setTimeout只运行一次吗
<!doctype html>
<html>
<head>
<title></title>
</head>
<body>
</body>
<script type="text/javascript">
function but(){
var t=0;
document.getElementById("txt").value=t;
t=t+1;
var mychar=setTimeout("but()",1000);
}
</script>
</body>
<input type="text" id="txt"/>
<input type="button" value="开始" onclick="but()"/>
</html>