//单选checkbox
$(“input[name=actions]”).change(function () {
var result="";
$("input[name='actions']:checked").each(function(){
result+=$(this).val()+',';
});
if(result!=""){
result=result.substring(0,result.lastIndexOf(','));
}
$("#selects").val(result);
});
//全选
$("#checkall").click(function() {
var result="";
$("input[name='actions']").each(function(){
result+=$(this).val()+',';
$(this).prop("checked", true);
});
if(result!=""){
result=result.substring(0,result.lastIndexOf(','));
}
$("#selects").val(result);
});
反选
$(“#delcheckall”).click(function() {
$("input[name='actions']").prop("checked", false);
$("#selects").val("");
});