Style cssText Property
The Style object
Definition and Usage
The cssText property sets or returns the content of a style declaration as a string.
Syntax
Set the cssText attribute:
Object.style.cssText="
string
"
Return the cssText attribute:
Object.style.cssText
| Value | Description |
|---|---|
| string | Specifies the content of a style declaration. |
Browser support





All major browsers support the cssText property.
Example
Example
Get a style declaration as a string:
This is a paragraph.
Try it »
The Style object