for(var i in document.styleSheets) <-- doesnt work { document.styleSheets[i] is undefined always } for(var i=0; i<document.styleSheets.length; i++) { document.styleSheets[i] works! }
The problem is that iterating over document.styleSheets only returns "item" and "length", not the numeric indices. In Firefox it returns the numeric indices followed by "item" and "length".
It seems this affects HTMLCollection along with StyleSheetList. There are probably others.
This is the same as bug 8080. *** This bug has been marked as a duplicate of 8080 ***