I am wondering how I can read CSS comments out of a linked stylesheet.
I have this sample CSS loaded via:
<link rel="stylesheet" type="text/css" media="all" href="test.css" />
#test1{ border:1px solid #000; }
#test2{ border:1px solid #000; }
#test3{/* sample comment text I'm trying to read */}
I'm testing this in FF3. The following javascript reads the rules but doesn't read the comments in #test3
.
window.onload = function(){
s=document.styleSheets;
for(i=0;i < s[0].cssRules.length;i++){
alert(s[0].cssRules[i].cssText);
}
}