jquery 设置checkbox全选 全不选
2014-04-22 17:03
225 查看
<input id="all" type='checkbox' />
<input type='checkbox' value='1’ name="mailId"/>
<input type='checkbox' value='2‘ name="mailId"/>
<input type='checkbox' value='3‘ name="mailId"/>
js中
$(document).ready(function(){
//全选、全不选
$("#all").click(function(){
if(this.checked){
$("input[name='mailId']").prop("checked", true);
}else{
$("input[name='mailId']").prop("checked", false);
}
});
})
<input type='checkbox' value='1’ name="mailId"/>
<input type='checkbox' value='2‘ name="mailId"/>
<input type='checkbox' value='3‘ name="mailId"/>
js中
$(document).ready(function(){
//全选、全不选
$("#all").click(function(){
if(this.checked){
$("input[name='mailId']").prop("checked", true);
}else{
$("input[name='mailId']").prop("checked", false);
}
});
})
相关文章推荐
- jQuery使用prop设置checkbox全选、反选
- jQuery设置checkbox全选(区别jQuery版本)
- jQuery使用prop设置checkbox全选、反选
- JQuery - 设置复选按钮checkbox全选/反选
- jQuery 设置checkbox全选
- CheckBox全选/全消设置和GridView自增序号
- jquery checkbox全选--~!
- JQuery下CheckBox全选全不选反选
- js || jQuery 复选框(checkbox)全选/全不选/反选
- input checkbox jquery全选
- jQuery实现checkbox全选和反选
- jQuery CheckBox全选、全不选实现代码小结
- Jquery---checkbox的全选或者全部取消
- JQuery实现的 checkbox 全选、反选。
- jquery实现复选框checkbox全选(完善)
- jQuery之checkbox全选
- JQuery 判断checkbox是否选中,checkbox全选反选,以及执行click事件
- Jquery之CheckBox全选与反选
- jquery、js全选反选checkbox
- jquery checkbox部分全选