Get a CSS value from external style sheet with Javascript/jQuery
Posted
by Acorn
on Stack Overflow
See other posts from Stack Overflow
or by Acorn
Published on 2010-04-25T09:47:33Z
Indexed on
2010/04/25
10:03 UTC
Read the original article
Hit count: 244
Is it possible to get a value from the external CSS of a page if the element that the style refers to has not been generated yet? (the element is to be generated dynamically).
The jQuery method I've seen is $('element').css('property','value');
, but this relies on element
being on the page. Is there a way of finding out what the property is set to within the CSS rather than the computed style of an element?
Will I have to do something ugly like add a hidden copy of the element to my page so that I can access its style attributes?
© Stack Overflow or respective owner