Finding an unmanageable CSS class style with jQuery

Does jQuery provide a way to find the style defined in a CSS class without first assigning this class to an element?

eg. given the following CSS, I would like to get the Color style assigned by myClass -

.myClass {
  color: #ff0000;
}

So far, the only way I've found is to temporarily assign a class to an element and then poll the element, but I get inconsistent results between different browsers.

Thank you for your time!

+3
source share
1 answer

Check out jQuery.rule ( http://flesler.blogspot.com/2007/11/jqueryrule.html ) seems to be what you are looking for

+1
source

Source: https://habr.com/ru/post/1724260/


All Articles