编辑下面的代码:【加编码】
<html> <body> E-mail: <input type="email" id="myEmail"><br><br> <button onclick="disableBtn()">禁用 Email 字段</button> <button onclick="undisableBtn()">启用 Email 字段</button> <script> function disableBtn() { document.getElementById("myEmail").disabled = true; } function undisableBtn() { document.getElementById("myEmail").disabled = false; } </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂