runtimeStyle Object
Home | Top | Web development | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.


runtimeStyle Object

Represents the cascaded format and style of the object that overrides the format and style specified in global style sheets, inline styles, and HTML attributes.

Remarks

The runtimeStyle object sets and retrieves the format and style of an object, and overrides existing formats and styles in the process. Other than having precedence over the style object and not persisting, the runtimeStyle object is equivalent to the style object.

To change or clear multiple style properties at once, use this object with the cssText property. For example, to change the font color and background color of a DIV element, you could use the following code: <DIV onclick="this. runtimeStyle .cssText = 'color:red;background-color:blue;border:5px solid black;'"> Click on this DIV to change style properties.</DIV>

Example

This example sets a value on the runtimeStyle object to affect the currentStyle object, but not the style object.

 

<SCRIPT>
function fnChangeValue(sValue)
{ if(oDIV. runtimeStyle .backgroundColor == oDIV.style.backgroundColor)
{ sValue=""; } oDIV. runtimeStyle .backgroundColor = sValue;
alert(oDIV.style.backgroundColor + "\n" + oDIV.currentStyle.backgroundColor + "\n" + oDIV. runtimeStyle .backgroundColor); }
</SCRIPT>
<DIV ID = "oDIV"> This is a demonstration DIV. </DIV>
<INPUT TYPE = "button" VALUE = "Change Color" onclick="fnChangeValue('blue')">

Standards Information

There is no public standard that applies to this object.

Applies To

Platform Version
Win16: 5
Win32: 5
Unix: 5
Mac: 5
Windows CE: N/A
 
A , ACRONYM , ADDRESS , APPLET , B , BIG , BLOCKQUOTE , BODY , BR , BUTTON , CAPTION , CENTER , CITE , CODE , COL , COLGROUP , CUSTOM , cssText , DD , DEL , DFN , DIR , DIV , DL , DT , EM , EMBED , FIELDSET , FONT , FORM , FRAME , FRAMESET , hn , HR , HTML , I , IFRAME , IMG , INPUT type=button , INPUT type=checkbox , INPUT type=file , INPUT type=hidden , INPUT type=image , INPUT type=password , INPUT type=radio , INPUT type=reset , INPUT type=submit , INPUT type=text , INS , KBD , LABEL , LEGEND , LI , LISTING , MARQUEE , MENU , NOBR , OBJECT , OL , OPTION , P , PLAINTEXT , PRE , Q , S , SAMP , SELECT , SMALL , SPAN , STRIKE , STRONG , SUB , SUP , TABLE , TBODY , TD , TEXTAREA , TFOOT , TH , THEAD , TR , TT , U , UL , VAR , XMP
Home | Top | Web development | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.