If you start with an element, there is no way to know which style sheet rules apply to it. getComputedStyle()it just gives you an effective style value, and currentStylenot much different, even if it gives you the result you expect in this particular scenario and in this particular browser.
What you probably need to do is go through the stylesheets. Line by line:
for (var i = 0; i < document.styleSheets.length; i++)
{
var styleSheet = document.styleSheets[i];
for (var j = 0; j < styleSheet.cssRules.length; j++)
{
var rule = styleSheet.cssRules[j];
if (rule.type == 1)
{
}
}
}
, , document.querySelectorAll() rule.selectorText. , , . , .
: