//全选/全不选 $("#datalist").on("change","#checkall",function(){ if(this.checked){ $("input[name='form-field-checkbox']").prop('checked', true); }else{ $("input[name='form-field-checkbox']").prop('checked', false); } });