编辑下面的代码:【加编码】
<html> <body> <form> Address:<br> <textarea id="mytxt"> 342 Alvin Road Ducksburg</textarea> </form> <p>Click the button below to disable the text area.</p> <button onclick="disableElement()">Disable Textarea</button> <script> function disableElement() { document.getElementById("mytxt").disabled=true; } </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂