$("input[name='checkbox']:checkbox").each(function(){ if($(this).attr("checked")){ idStr += $(this).attr("id")+":"; nameStr += $(this).val()+"шшш"; } })