简单的写了一个根据checkbox的勾选与否决定按钮能否使用
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script src="../jquery-3.2.1/jquery-3.2.1.js"></script> <script type="text/javascript"> $(function() { $("#xieyi").click(function() { if($("#xieyi").prop("checked") == true) { $("#register").removeAttr("disabled"); } else { $("#register").attr("disabled", "disabled"); } }); }); </script> </head> <body> 同意该协议<input type="checkbox" name="xieyi" id="xieyi" /> <input type="button" name="register" id="register" value="注册" disabled="disabled" /> </body> </html>