2011-12-05 94 views

回答

4
$('#' + radio.id).closest('form').find('input:checkbox:checked') 
15

使用单一的选择:

$("#formid input:checkbox:checked").each(function() { 
    $(this) // do your staff with each checkbox 
}); 
0
$("input:checkbox[name='type']:checked").each(function() 
{ 
    // add $(this).val() to your array 
}); 
+0

他并不想通过名称来过滤,除了你需要引用ATTR值('[NAME = “型”]') – ThiefMaster

+0

感谢您的纠正。他想要得到所有选中的元素吗?这会工作吗? – FosterZ

相关问题