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.
var value = style.getPropertyCSSValue(property);
property
is a DOMString
representing the property name to be retrieved.value
is a CSSValue
containing the CSS value for a property. If none exists, returns null
.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();
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. |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | ? — 41
|
No | ? — 62
|
No | 15 — 28
|
Yes |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | ? — 41
|
No | ? — 62 | 15 — 28
|
Yes | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/getPropertyCSSValue