<td> <input type=”checkbox” name=”pro_ids” value=”<?php echo $p_id; ?>”> </td>
checkbox知识点:
1.判断复选框是否被选中 var pid = $(“input[name=’pro_ids’]”).is(‘:checked’);
2.获取单个checkbox选中的值 var checks = $(‘input[name=pro_ids]:checked’).val();
3.批量获取checkbox的值 var checks = document.getElementsByName(“pro_ids”); var ids = “”; if(checks&&checks.length>0){ for(var i=0;i<checks.length;i++){ if(checks[i].checked){ if(ids.length>0)ids+=”,”; ids+=checks[i].value; } } }