I get a null error on the line this
document.getElementById("Attachment" + x).style.display = "none";
I really dont want to write this out 5 times. The line does work if i do this.
document.getElementById("Attachment1").style.display = "none";
What am i missing here? To keep this short i only included the loop where ther error is.
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";
}
}
You probably don’t have an element with ID
Attachment0.