<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <script src="../static/js/jquery-3.0.0.min.js"></script> <body> <input type="checkbox" id="cr"><label for="cr">我已经阅读了上面制度</label> <script> $(document).ready(function () { var cr=$("#cr"); cr.click(function(){ if(cr.is(":checked"))//jquery方法判断 { alert("感谢你的支持!"); } }) }) </script> </body> </html>
jQuery的:checked的用法
最新推荐文章于 2025-05-28 11:39:43 发布