for循环延迟执行
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>计时器</title>
<script type="text/javascript">
var na = "小明:87;小花:81;小红:97;小天:76;小张:74;小小:94;小西:90;小伍:76;小迪:64;小曼:76";
var cf = na.split(";");
function test01() {
for (var i = 0; i < cf.length; i++) {
document.getElementById("txt").value = cf[i];
}
}
</script>
</head>
<body>
<form>
<input type="text" id="txt">
<input type="button" value="start" onClick="test01()">
<input type="button" value="Stop" onClick="test02()">
</form>
</body>
</html>
怎么能让cf[i] 循环在input里显示一遍