时间:2021-05-17 08:41:14 | 栏目:jquery | 点击:次
获取所有name为spCodeId的checkbox
var spCodesTemp = ""; $('input:checkbox[name=spCodeId]:checked').each(function(i){ if(0==i){ spCodesTemp = $(this).val(); }else{ spCodesTemp += (","+$(this).val()); } }); $("#txt_spCodes").val(spCodesTemp);