fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <form> 用户名:<input type="text" id="usrname"><br> 密码:<input type="password" id="pwd"> </form> <p>单击下面的按钮禁用上面的密码字段</p> <button onclick="disableElement()">禁用密码字段</button> <script> function disableElement(){ document.getElementById("pwd").disabled=true; } </script> </body> </html>
运行结果