var num=0;
function numCount(){
document.getElementById('txt').value=num;
if(num<3){
num=num+1;
setTimeout("numCount()",1000);
}else{
num=0;
}
没有int,用var