1 $('input[name="checkbox"]').click(function() {
 2         if ($(this).is(':checked')) {
 3             $('input[name="checkname"]').each(function() {
 4                 $(this).prop("checked", true);
 5             });
 6         } else {
 7             $('input[name="checkname"]').each(function() {
 8                 $(this).prop("checked", false);
 9             });
10         }
11     })

 

posted on 2021-05-28 20:07  Topcoder-V  阅读(65)  评论(0编辑  收藏  举报