我想实现无限321的循环,if语句怎么改成for循环
var num=0;
function numCount(){
document.getElementById('txt').value=num;
if(num<3){
num=num+1;
setTimeout("numCount()",1000);
}else{
num=0;
setTimeout("numCount()",1000);
}
}
var num=0;
function numCount(){
document.getElementById('txt').value=num;
if(num<3){
num=num+1;
setTimeout("numCount()",1000);
}else{
num=0;
setTimeout("numCount()",1000);
}
}
2018-06-28
举报