JavaScript 协议按钮禁用
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> </head> <body> <textarea name="" id="" cols="30" rows="10"> 我就是协议,请仔细阅读 </textarea><br/> <input type="button" value="请仔细阅读协议(5)" id="bt" disabled="disabled"/> <script src="common.js"></script> <script> var time = 5; var timeId = setInterval(function () { time--; my$("bt").value = "请仔细阅读协议(" + time + ")"; if (time <= 0) { clearInterval(timeId); my$("bt").value = "注册"; my$("bt").disabled = false; } }, 1000); </script> </body> </html>