fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> 姓: <input type="text" id="myText" value="Mickey"><br> <button onclick="disableTxt()">禁用文本域</button> <button onclick="undisableTxt()">启用文本域</button> <script> function disableTxt() { document.getElementById("myText").disabled = true; } function undisableTxt() { document.getElementById("myText").disabled = false; } </script> </body> </html>
运行结果