Jquery – get CSS rule’s percentage value in jQuery


Let's say the rule is as follows:

.largeField {
    width: 65%;

Is there a way to get '65%' back somehow, and not the pixel value?


EDIT: Unfortunately using DOM methods is unreliable in my case, as I have a stylesheet which imports other stylesheets, and as a result the cssRules parameter ends up with either null or undefined value.

This approach, however, would work in most straightforward cases (one stylesheet, multiple separate stylesheet declarations inside the head tag of the document).

Best Solution

Most easy way


// >>> "65%"