CODE:
function checkAll() {
var now = new Date();
var chkBoxes = document.getEle mentsByName('ch kMe');
for (var limit = 0; limit < chkBoxes.length ; limit ++) {
while(((new Date()).getTime () - now.getTime()) < 1000) {} //Delay 1 sec.
chkBoxes[limit].checked = true;
}
}
I have so many check boxes in my screen, the above function will check the check boxes one by one with a delay of 1 second. But the changes are reflected on the screeen only after the completion of loop. I need to see the changes on time.
What can I do for this ?
function checkAll() {
var now = new Date();
var chkBoxes = document.getEle mentsByName('ch kMe');
for (var limit = 0; limit < chkBoxes.length ; limit ++) {
while(((new Date()).getTime () - now.getTime()) < 1000) {} //Delay 1 sec.
chkBoxes[limit].checked = true;
}
}
I have so many check boxes in my screen, the above function will check the check boxes one by one with a delay of 1 second. But the changes are reflected on the screeen only after the completion of loop. I need to see the changes on time.
What can I do for this ?
Comment