JavaScript Reference/Javascript Properties/disabled

Материал из Web эксперт
Перейти к: навигация, поиск

"disabled" Example

   <source lang="javascript">
   

<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>


     </source>
   
  


"disabled" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<a> <acronym> | | |<address> <area> | | | <basefont> | | | <basefont> | | |<bgsound> |

| |
<body> |

| |
<button> |

| |
|

| | | | |<col> <comment> | | |<custom>

| | |defaults | | | <dir> |

| |
|

| |

| | |<embed> <fieldset> | | | <form> | | |<frame> <head> |

| |<hn>
|

| |<html> | | |<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"> | | |<isindex> | | |<label> <legend> |

| |
  • <link> | | |<listing> <map> | | |<marquee> <menu> | | |<nobr> <object> | | |
      <optgroup> (IE6) | | |<option>

      | | |<plaintext>

                               |
      |                |                                                       |
      |                |                                                     |
      |                |                          <script>                      |
      |                |<select>                                               |
      |                |                                                |
      |                |                        <style>                       |
      |                |styleSheet                                               |
      |                |                                                  |
      |                |                          |
      |                |                                                       |
      |                |
        | | |<xmp> | +----------------+--------------------------------------------------------------+ </source>

        "disabled" Possible Values

        <source lang="javascript"> Possible Values true false the default


        </source>



        "disabled" Syntax and Note

        <source lang="javascript"> Note: Read and write property. Disable the element or not.

        Syntax:

        document.all.elementID.disabled = value


        </source>

      <textarea> | | |<title>