You are here: Reference > JavaScript > client-side > style handling > properties > disabled (styleSheet)

disabled property (styleSheet)

Browser support:
Sets or retrieves a Boolean value that indicates the interaction privileges of the current styleSheet object.


You can find the related objects in the Supported by objects section below.
This property is read/write.

Possible values:

Boolean that indicates whether the user can interact with the object.
One of the following values:
Interaction is enabled.
Interaction is disabled.
Default: this property has no default value.

Example HTML code 1:

This example shows how to change the disabled state of the styleSheet object:
        .red {
            color: red;
    <script type="text/javascript">
        function DisableRed () {
            document.styleSheets[0].disabled = true;

        function EnableRed () {
            document.styleSheets[0].disabled = false;
    <button onclick="DisableRed ();">Disable '.red' styleSheet</button>
    <button onclick="EnableRed ();">Enable '.red' styleSheet</button>
    <br /><br />
    <div class="red">red division</div>
    <div>non-red division</div>
    <span class="red">red span</span>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content