1 out of 8 rated this helpful - Rate this topic

cssText property

Sets or retrieves the persisted representation of the style rule.

This property is read/write.

Syntax

JavaScript

object.cssText = p

p = object.cssText

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

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.