2
2nervous
I created the following function to change the visibility of nine
different table cells. It appears to only execute the first instead of
looping. How can I get it to loop through?
function toggleSelection(ID) {
var i=1
for (i=1;i<=9;i++)
{
var pID = "cell-" + i + "-id-" + ID;
var cell = document.getElementById(pID);
if(cell.style.visibility == "hidden" || !cell.style.visibility) {
cell.style.visibility = "visible";
}
else if(cell.style.visibility == "visible") {
cell.style.visibility = "hidden";
}
return false;
}
}
different table cells. It appears to only execute the first instead of
looping. How can I get it to loop through?
function toggleSelection(ID) {
var i=1
for (i=1;i<=9;i++)
{
var pID = "cell-" + i + "-id-" + ID;
var cell = document.getElementById(pID);
if(cell.style.visibility == "hidden" || !cell.style.visibility) {
cell.style.visibility = "visible";
}
else if(cell.style.visibility == "visible") {
cell.style.visibility = "hidden";
}
return false;
}
}