I am trying to find the index of a css rule .widget-area
in a stylesheet.
This is how I'm doing it, but it returns undefined
:
function findStyle(){
var myStylesheet=document.styleSheets[8].cssRules[".widget-area"];
console.log(myStylesheet);
};
If I leave out .cssRules[".widget-area"]
it returns all the rules of the stylesheet, but there are thousands of them.
Anyone knows how to do this? Thanks.