JQuery实现全选、取消全选、反向选择

【全选】

functionselectAll() {
  $("input[@name='multiValue']").each(function() {
     $(this).attr("checked", true);
});
}

【取消全选】

1 function cancelSelect() {
2 $("input[@name='multiValue']").each(function() {
3 $(this).attr("checked", false);
4 });
5 }


【反向选择】

1 function selectReverse() { 
2 $("input[name='multiValue']").each(function(){
3 $(this).attr("checked",!this.checked);
4 });
5 }


转载于:https://my.oschina.net/weisenz/blog/200651

猜你喜欢

转载自blog.csdn.net/weixin_34268310/article/details/91920867