jquery遍历checkbox介绍

时间:2014-02-21    点击:126   

checkbox 全选\全部取消
$("#ChkAll").click(function(){
    $("#divContent input[type='checkbox']").attr("checked",$(this).attr("checked"));
});

获取选中的checkbox的value值:
var arrChk=$("input[name='chk_list'][checked]");
    $(arrChk).each(function(){
       window.alert(this.value);                       
    });
});


$("#checkbox_id").attr("checked"); //获取一个CheckBox的状态(有没有被选中,返回true/false)

$("#checkbox_id").attr("checked",true); //设置一个CheckBox的状态为选中(checked=true)

常规表格多表头查询示例
Javascript中引用示例介绍
jquery解析XML字符串和XML文件的方法说明
js 删除数组的几种方法小结
jquery制作居中遮罩层效果分享
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved