<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script type="text/javascript"> window.onload = function () { // 按钮不可用, 禁用 document.getElementById('btnLogin').disabled=true; //// 按钮可用, 启用 //document.getElementById('btnLogin').disabled=false; } </script> </head> <body> <input type="button" id="btnLogin" value="登录"/> </body> </html>