Easy Tutorial
❮ Prop Style Flexbasis Jsref Tostring Date ❯

CSSStyleDeclaration getPropertyValue() Method

CSS CSSStyleDeclaration

Example

Return the value of the color property:

var declaration = document.styleSheets[0].cssRules[0].style;
var propvalue = declaration.getPropertyValue("color");
alert(propvalue);

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 property name to be checked.

Technical Details

DOM Version: CSS Object Model
Return Value: String, representing the property value.
--- ---

CSS CSSStyleDeclaration

❮ Prop Style Flexbasis Jsref Tostring Date ❯