您的位置:首页 > Web前端 > JQuery

jquery 对asp.net CheckBoxList全选、反选

2011-08-09 15:49 661 查看
第一种:

全选

$(".checkBoxSelect").each(function(){

$(this).attr("checked",
true);

});

反选

$(".checkBoxSelect").each(function(){

if($(this).attr("checked"))

{

$(this).attr("checked",
false);

}

else

{

$(this).attr("checked",
true);

}

});

第二种

全选

$("#<%=CheckBoxList.ClientID%>input:checkbox").each(function(index,domEle){

if(this.type=="checkbox")

this.checked=true;

});反选

$("#<%=CheckBoxList.ClientID%>input:checkbox").each(function(index,domEle){

if(this.type=="checkbox")

this.checked=!this.checked;

});


                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: