<html>
<head>
<script src="jquery-1.3.2.min.js" type="text/javascript"></script>
</head>
<body>
<input type="checkbox" name="chk_list" id="chk_list_1" value="1" />1<br />
<input type="checkbox" name="chk_list" id="chk_list_2" value="2" />2<br />
<input type="checkbox" name="chk_list" id="chk_list_3" value="3" />3<br />
<input type="checkbox" name="chk_list" id="chk_list_4" value="4" />4<br />
<input type="checkbox" name="chk_all" id="chk_all" />全选/取消全选
<script type="text/javascript">
$("#chk_all").click(function(){
$("input[name='chk_list']").attr("checked",$(this).attr("checked"));
});
</script>
</body>
</html
<script type="text/javascript"> //获取到所有name为'chk_list'并选中的checkbox(集合) var arrChk=$("input[name='chk_list]:checked"); //遍历得到每个checkbox的value值 for (var i=0;i<arrChk.length;i++) { alert(arrChk[i].value); } </script>
来自:http://www.cnblogs.com/bynet/archive/2009/11/13/1602491.html