disabled 属性可设置或返回是否应禁用文本框。
textareaObject.disabled=true|false
下面的例子可禁用并启用文本框:
<html> <head> <script type="text/javascript"> function disable() {document.getElementById('txt1').disabled=true;
} function enable() {document.getElementById('txt1').disabled=false;
} </script> </head> <body> <textarea id="txt1"> Hello world....This is a text area </textarea> <br /> <input type="button" onclick="disable()" value="Disable" /> <input type="button" onclick="enable()" value="Enable" /> </body> </html>