為什么一加上while循環(huán),getElementById就找不到id了?而且,我把定時(shí)器放在while里面,不是應(yīng)該執(zhí)行完setTimeout(tom,3000);才進(jìn)入下一輪循環(huán)嗎?while(i<6){
i++; var tom = function (){document.getElementById('x'+i).style.zIndex=9999;
setTimeout(tom,3000);
};
這段js代碼哪里出錯(cuò)了?
寶慕林4294392
2018-08-07 11:10:24