Retrieves the value indicating whether the user can interact with the object. dhtml语法 HTML | N/A |
---|
Scripting | [ bDisabled = ] object.isDisabled |
---|
DHTML可能的值 bDisabled | Boolean that
receives one of the following values.false | User can interact with the object. | true | User cannot interact with the object. |
|
The property is read-only.
The property has no default value.
DHTML代码范例
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>
是否符合公共标准
There is no public standard that applies to this property.
Applies To |
A,
ACRONYM,
ADDRESS,
APPLET,
AREA,
B,
BASE,
BASEFONT,
BDO,
BGSOUND,
BIG,
BLOCKQUOTE,
BODY,
BR,
BUTTON,
CAPTION,
CENTER,
CITE,
CODE,
COL,
COLGROUP,
COMMENT,
CUSTOM,
DD,
DEL,
DFN,
DIR,
DIV,
DL,
DT,
EM,
EMBED,
FIELDSET,
FONT,
FORM,
FRAME,
FRAMESET,
HEAD,
hn,
HR,
HTML,
I,
IFRAME,
IMG,
INPUT type=button,
INPUT type=checkbox,
INPUT type=file,
INPUT type=hidden,
INPUT type=image,
INPUT type=password,
INPUT type=radio,
INPUT type=reset,
INPUT type=submit,
INPUT type=text,
INS,
ISINDEX,
KBD,
LABEL,
LEGEND,
LI,
LINK,
LISTING,
MAP,
MARQUEE,
MENU,
nextID,
NOBR,
NOFRAMES,
NOSCRIPT,
OBJECT,
OL,
OPTION,
P,
PLAINTEXT,
PRE,
Q,
RT,
RUBY,
S,
SAMP,
SCRIPT,
SELECT,
SMALL,
SPAN,
STRIKE,
STRONG,
styleSheet,
SUB,
SUP,
TABLE,
TBODY,
TD,
TEXTAREA,
TFOOT,
TH,
THEAD,
TITLE,
TR,
TT,
U,
UL,
VAR,
WBR,
XML,
XMP | |
|