according to your update, I guess you do not need the for loop, you need this,
demo
function countdown(integer) {
var time = setInterval(function(){
document.getElementById("cds").value="->"+(integer--)+"<-"
if (integer == 0) clearInterval(time);
},1000);
}
1
solved For loops in JavaScript