Я не уверен, что вы хотите сделать с этим, но это должно начать вас:
function getStyles() {
if(!document.styleSheets) return false; // return false if browser sucks
var rules = new Array();
for (var i=0; i < document.styleSheets.length; i++) {
var x = 0;
styleSheet = document.styleSheets[i];
if(styleSheet.cssText) { // if this is IE, get the rules directly
rules.push(styleSheet.cssText);
} else {
// otherwise get them individually
do {
cssRule = styleSheet.cssRules[x];
if(cssRule) rules.push(cssRule.cssText);
x++;
} while (cssRule);
}
}
return rules;
}
Когда вы вызываете это, он возвращает массив всех правил. Протестировано в Firefox, IE.