CSS Style Declaration Object
CSSStyleDeclaration object
A CSSStyleDeclaration object represents a collection of CSS property-value pairs.
CSSStyleDeclaration Object Properties
Attribute | Description |
---|
cssText | Sets or returns the style declaration text, cssText corresponds to the style attribute of the HTML element. |
length | Returns how many declarations are included in the style. |
parentRule | Returns the rule containing the current rule. |
CSSStyleDeclaration object methods
Methods | Description |
---|
getPropertyPriority() | Returns whether the specified CSS property has the "important!" property set. |
getPropertyValue() | Returns the specified CSS property value. |
item() | Returns the CSS property name in the CSS declaration by index. |
removeProperty() | Remove CSS properties from CSS declarations. |
setProperty() | Create or modify CSS properties in CSS declaration blocks. |