function GetCheckboxvalues() {var optIDs = '';jQuery("input:checkbox[name='OperationID']:checked").each(function() { optIDs += this.value + ','; }); //遍历,用逗号串联 alert(optIDs); }
还有一种是利用数组函数处理字符串
function GetCheckboxvalues() {var optIDs = new Array();jQuery("input:checkbox[name='OperationID']:checked").each(function() { optIDs.push(this.value); }); //遍历,用逗号串联 alert(optIDs.join(',')); }