JavaScript Reference/Javascript Properties/disabled
Содержание
"disabled" Example
<html>
<body>
<script>
function function1() {
document.all.myButton.disabled = true;
}
function function2() {
document.all.myButton.disabled = false;
}
</script>
<input id="myButton" type="button" value="Disable" onClick="function1();">
<input type="button" value="Enable" onClick="function2();">
</body>
</html>
"disabled" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |<a> <acronym> |
| |<address> <area> |
| |<b> <basefont> |
| |<bdo> <basefont> |
| |<bgsound> <big> |
| |<blockquote> <body> |
| |<br> <button> |
| |<caption> <center> |
| |<cite> <code> |
| |<col> <comment> |
| |<custom> <dd> |
| |defaults <del> |
| |<dfn> <dir> |
| |<div> <dl> |
| |<dt> <em> |
| |<embed> <fieldset> |
| |<font> <form> |
| |<frame> <head> |
| |<hn> <hr> |
| |<html> <i> |
| |<iframe> <img> |
| |<input type="button"> <input type="checkbox"> |
| |<input type="file"> <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> |
| |<nobr> <object> |
| |<ol> <optgroup> (IE6) |
| |<option> <p> |
| |<plaintext> <pre> |
| |<q> <rt> |
| |<ruby> <s> |
| |<samp> <script> |
| |<select> <small> |
| |<span> <strike> |
| |<strong> <style> |
| |styleSheet <sub> |
| |<sup> <table> |
| |<td> <textarea> |
| |<title> <tr> |
| |<tt> <u> |
| |<ul> <var> |
| |<xmp> |
+----------------+--------------------------------------------------------------+
"disabled" Possible Values
Possible Values
true
false the default
"disabled" Syntax and Note
Note:
Read and write property.
Disable the element or not.
Syntax:
document.all.elementID.disabled = value