我就在这这是为什么来了空
document.getElementById("Attachment" + x).style.display = "none";
我真的不想写这5次行空的错误。如果我这样做,这条线就行。
document.getElementById("Attachment1").style.display = "none";
我在这里错过了什么?为了保持这个简短,我只包含了错误所在的循环。
for (x = 0; x < 5; x++)
{
if(showHideArray[x] > 0)
{
document.getElementById("Attachment" + x).style.display = "none";
}
else {
document.getElementById("Attachment" + x + "If").style.display = "none";
}
}
你是对的,先回答。我确实拥有一个带有Attachment0标识的元素。谢谢您的帮助! – user1015711 2012-01-13 23:27:38