You are here: Reference > JavaScript > client-side > HTML DOM > properties > isDisabled

isDisabled property

Browser support:
Returns a Boolean value that indicates whether the object is disabled.
The disable status can be modified with the disabled property.

Syntax:

object.isDisabled;
You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

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

Example HTML code 1:

This example illustrates the use of the isDisabled property:
<head>
    <script type="text/javascript">
        function ToggleDisable () {
            var myObj = document.getElementById ("mySelect");
            if (myObj.isDisabled) {
                myObj.disabled = (myObj.isDisabled == true)? false : true;
            } else {
                myObj.disabled = (myObj.disabled == true)? false : true;
            }
        }
    </script>
</head>
<body>
    <button onclick="ToggleDisable ();">Enable/disable input object</button>
    <input id="mySelect" type="text" value="Some content"/>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content