Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
The CSSStyleDeclaration.getPropertyCSSValue() method interface returns a CSSValue
containing the CSS value for a property. Note that it returns null
if the property name is a shorthand property.
You should use CSSStyleDeclaration.getPropertyValue()
instead.
Syntax
var value = style.getPropertyCSSValue(property);
Parameters
property
is aDOMString
representing the property name to be retrieved.
Return value
value
is aCSSValue
containing the CSS value for a property. If none exists, returnsnull
.
Example
The following JavaScript code gets an object containing the computed RGB values of the color
CSS property:
var style = window.getComputedStyle(elem, null); var rgbObj = style.getPropertyCSSValue('color').getRGBColorValue();
Specifications
Specification | Status | Comment |
---|---|---|
Document Object Model (DOM) Level 2 Style Specification The definition of 'CSSStyleDeclaration' in that specification. |
Obsolete | Declared as obsolete in July 2003. |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
getPropertyCSSValue | Chrome
No support
? — 41
| Edge
No support
No
| Firefox
No support
1 — 62
| IE No support No | Opera
No support
15 — 28
| Safari Full support 6 | WebView Android
No support
? — 41
| Chrome Android
No support
? — 41
| Firefox Android No support 4 — 62 | Opera Android
No support
14 — 28
| Safari iOS Full support Yes | Samsung Internet Android
No support
? — 4.0
|
Legend
- Full support
- Full support
- No support
- No support
- Deprecated. Not for use in new websites.
- Deprecated. Not for use in new websites.
- See implementation notes.
- See implementation notes.