rollOrDie Posted December 29, 2008 Share Posted December 29, 2008 Im trying to create a script that will edit css rules in both FF and IE, but IE just isn't having any of it! I get an error message saying that 'the object doesn't support this property or method'. Here is my code, can anybody help? var styleSheet = document.styleSheets[1]; if (styleSheet.rules) { var pAbout1 = styleSheet.rules[20].style; var pAbout2 = styleSheet.rules[22].style; var pAbout3 = styleSheet.rules[23].style; } else { var pAbout1 = styleSheet.cssRules[20].style; var pAbout2 = styleSheet.cssRules[22].style; var pAbout3 = styleSheet.cssRules[23].style; } pAbout2.setProperty ('display', 'none', ''); pAbout3.setProperty ('display', 'none', ''); Link to comment https://forums.phpfreaks.com/topic/138795-ie-stylesheet-object-problem/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.