$(function(){ $('[level=1]').click(function(){ if(this.checked){ $(this).parent().find('input').prop('checked','checked'); } else{ $(this).parent().find('input').removeAttr('checked'); } }); $('[level=2]').click(function(){ if (this.checked) { $('[level=1]').prop('checked','checked'); } else{ $(this).parent().find('input').removeAttr('checked'); } }); });
checkbox选中父级父级跟随选中
最新推荐文章于 2021-07-28 18:27:25 发布