$("#cb_classType_all").change(function () {
   if ($(this).is(":checked")) {
       $(".cb_classType").prop("checked", true);
   } else {
       $(".cb_classType").prop("checked",false);
   }
});

 

通过is(":checked")判断checkbox是否被选择,在通过

.prop("checked", true) 选择checkbox
.prop("checked",false) 取消checkbox选中
 

相关文章:

  • 2022-12-23
  • 2021-05-19
  • 2021-12-02
  • 2021-10-16
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2021-06-27
  • 2022-12-23
  • 2021-06-23
  • 2022-12-23
相关资源
相似解决方案