CSSStyleDeclaration

Availability

BlackBerry Device Software version 4.6 or later

The CSSStyleDeclaration object represents a CSS declaration block consisting of CSS properties and their values. This object enables you to determine the style properties currently set in a block or to set style properties explicitly within the block.

This object also provides access to the computed values of an element. It does not provide access to the specified or actual values of the CSS cascade.

Properties

Property name

Type

Description

Status

Support level

Availability

cssText

DOMString

Specifies the name of the CSS selector for the rule set.

writable

DOM 2 Style

4.6+

length

int

Returns the number of properties that have been explicitly set.

read only

DOM 2 Style

4.6+

parentRule

CSSRule

Returns the CSSRule that contains this declaration block.

read only

DOM 2 Style

4.6+

Methods

Method name

Description

Support level

Availability

getPropertyCSSValue()

Returns the value of a CSS property as an object, if the property has been explicitly set.

DOM 2 Style

4.6+

getPropertyPriority()

Returns the priority of a CSS property.

DOM 2 Style

4.6+

getPropertyValue()

Returns the value of a CSS property as a string, if the property has been explicitly set.

DOM 2 Style

4.6+

item()

Returns the name of the CSS property at the specified index in the collection.

DOM 2 Style

4.6+

removeProperty()

Removes a CSS property from the style declaration block.

DOM 2 Style

4.6+

setProperty()

Sets the value of a CSS property for the style declaration block.

DOM 2 Style

4.6+

Last modified: 2014-03-10



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus