So sollte es in allen klappen
<script>
function suche_stylesheet_anweisung(gesuchter_selectorText) {
for (i = 0; i < document.styleSheets.length; i++) {
if(document.styleSheets[i].cssRules) {
var rule;
rule = document.styleSheets[i].cssRules;
}
else {
rule = document.styleSheets[i].rules;
}
for (j = 0; j < rule.length; j++) {
var current_selectorText = rule[j].selectorText;
var Ausgabetext = "i=" + i + "; j=" + j + "; Seletorname=" + current_selectorText;
if ( current_selectorText == gesuchter_selectorText ) {
Ausgabetext += "; Hurra - gefunden";
}
alert(Ausgabetext)
}
}
}
</script>