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
Microsoft Developer Network: [Windows Internet Explorer API reference Article]