This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

isDisabled

Property of dom/HTMLElementdom/HTMLElement

Syntax

var result = element.isDisabled;
element.isDisabled = value;

Examples

The following example shows how to use the isDisabled property to determine whether an object is disabled.

<HEAD>
<SCRIPT>
function chgInput() {
    currentState = oTextInput.isDisabled;
    newState = !currentState;
    oTextInput.disabled = newState;
    oCurrentValue.innerText = newState;
    newState==true ? oBtn.innerText="Enable" : oBtn.innerText="Disable"
}
</SCRIPT>
</HEAD>
<BODY onload="oCurrentValue.innerText = oTextInput.isDisabled;">
<P>Click the button to enable or disable the <B>INPUT</B>.</P>
<P>
<INPUT ID="oBtn" TYPE="button" VALUE="Disable" onclick="chgInput()" />
</P>
<P><INPUT ID="oTextInput" VALUE="This is some text." /></P>
Input disabled: <SPAN ID="oCurrentValue"></SPAN>
</BODY>

Syntax

Attributions