Name
CSSStyleDeclaration — a set of CSS style attributes and their values
Availability
DOM Level 2 CSS
Also Implements
If the implementation supports the “CSS2” feature in addition to the “CSS” feature (as most web browsers do), all objects that implement this interface also implement the CSS2Properties interface. CSS2Properties provides commonly used shortcut properties for setting and querying the values of CSS attributes. See CSS2Properties for details.
Properties
-
String cssText The textual representation of the style attributes and their values. This property consists of the complete text of the style rule, minus the element selector and the curly braces that surround the attributes and values. Setting this property to an illegal value throws a DOMException with a
codeofSYNTAX_ERR. Setting it for a read-only style sheet or rule throws a DOMException with acodeofNO_MODIFICATION_ALLOWED_ERR.-
readonly unsigned long length The number of style attributes in this style declaration.
-
readonlyCSSRuleparentRule The CSSRule object that contains this CSSStyleDeclaration, or
nullif this style declaration is not part of a CSS rule (such as for CSSStyleDeclaration objects that represent inline HTMLstyleattributes).
Methods
-
getPropertyCSSValue( ) Returns a CSSValue object that represents the value of the named CSS attribute, or
nullif that attribute is not explicitly set in this style declaration block or if the named style is a “shortcut” attribute.-
getPropertyPriority( ) Returns ...