全选<input type="checkbox" name="select" id="select" value="checkbox" onclick="selectAllCheckBox(this);" />
<input type='checkbox' name='id' value='"+list[i].id+"'/>
var arr = $("input[type='checkbox'][name='id']:checked"); var ids = ""; $.each(arr,function(index,o){ ids = ids + $(o).val()+","; }); ids = ids.substring(0,ids.length-1);
function selectAllCheckBox(o){ var arr = $("input[name='id']"); $.each(arr, function(index, current) { current.checked = o.checked; }); }