In reviewing his code, it appears that the largest source of issue was that apparently, in my code, you cannot index the "rules" object using a string.
Thus, the following code is more appropriate (for anyone who might be watching/stumble upon this code):
Code:function swapStyle() { var sCurrent; var iIndex; for (iIndex = 0 ; iIndex < document.styleSheets[0].rules.length ; iIndex++) { if(document.styleSheets[0].rules[iIndex].selectorText == ".hideable") break; } if(iIndex == document.styleSheets[0].rules.length) { alert('not found'); return; } sCurrent = document.styleSheets[0].rules[iIndex].style.display; if(sCurrent == "none") { document.styleSheets[0].rules[iIndex].style.display=""; } else { document.styleSheets[0].rules[iIndex].style.display="none"; } }




Reply With Quote