CSSStyleDeclaration Object

CSSStyleDeclaration Object

The CSSStyleDeclaration object represents a collection of CSS attribute-value pairs.

CSSStyleDeclaration Object Properties

Attribute Description
cssText Set or return the text representation of the CSS declaration block.
length Return the number of style declarations in the CSS declaration block.
parentRule Return the CSS rule that is the parent of the style block.

CSSStyleDeclaration Object Methods

Method Description
getPropertyPriority() Return whether the specified CSS property has the "important!" priority.
ggetPropertyValue() Return the value of the specified CSS property.
item() Return CSS property names from the CSS declaration block by index.
removeProperty() Remove CSS properties from the CSS declaration block.
setProperty() Set new or modify existing CSS properties in the CSS declaration block.