cssText property
Sets or retrieves the persisted representation of the style rule.
This property is read/write.
Syntax
| JavaScript | |
|---|
Property values
Type: String
the text.
Remarks
This property reflects the current state of the rule and not its initial value.
Examples
This example uses the cssText property to retrieve the CSS style set on an object.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/cssText.htm
<p id="oPara" style="color:'green'; font-weight:bold"> This is the test paragraph.</P> : <button onclick="alert(oPara.style.cssText)"> Get CSS attributes</button>
See also
- CSSStyleDeclaration
- currentStyle
- runtimeStyle
- style
- styleSheet
- CSSFontFaceRule
- CSSImportRule
- CSSMediaRule
- CSSNamespaceRule
- CSSRule
- page
- rule
Send comments about this topic to Microsoft
Build date: 11/29/2012