CSSStyleDeclaration getPropertyValue() Method
❮ CSSStyleDeclaration Object
Example
Return the value of the color property:
var declaration = document.styleSheets[0].cssRules[0].style;
var
propvalue = declaration.getPropertyValue("color");
alert(propvalue);
Try it Yourself »
Definition and Usage
The getPropertyValue() method returns the value of the specified CSS property.
Browser Support
Method |
|
|
|
|
|
getPropertyValue() |
Yes |
9.0 |
Yes |
Yes |
Yes |
Syntax
object.getPropertyValue(propertyname)
Parameter Values
Parameter |
Description |
propertyname |
Required. A String representing the name of the property to check
|
Technical Details
DOM Version: |
CSS Object Model |
Return Value: |
A String, representing the value of the property |
❮ CSSStyleDeclaration Object