Click to return to the DHTML, HTML     
DISABLED Attribute | disa...     display Attribute | displ...     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

disabled Property


Sets or retrieves whether a style sheet is applied to an object.

Syntax

HTMLN/A
ScriptingstyleSheet.disabled [ = bDisabled ]

Possible Values

bDisabled Boolean that specifies one of the following values:
falseStyle sheet is applied to the object.
trueStyle sheet is not applied to the object.

The property is read/write with a default value of false.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see Dynamic Properties.

Remarks

The value of this property can also change per media-dependent style sheets.

Example

This example uses the disabled property to indicate whether a style sheet is applied to the BODY element.

Sample Code

<STYLE>
BODY {background-color: #000000; color: #FFFF00;}
</STYLE>
<SCRIPT>
function fnToggle(){
   var oStyle=document.styleSheets[0];
   if(oStyle.disabled==true){
      oStyle.disabled=false;
   }
   else{
      oStyle.disabled=true;
   }
}
</SCRIPT>
<BODY>
<P>
Click Toggle Style Sheet to enable/disable
styles applied to the BODY element.
</P>
<P>
<INPUT TYPE="button"
   VALUE="Toggle Style Sheet"
   onclick="fnToggle()">
</P>
</BODY>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
styleSheet


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.