// 全选 $('#allcheck').click(function(){ $('input[name="check"]').prop('checked','true'); }); //反选 $('#reversecheck').click(function(){ $('input[name="check"]').each(function () { $(this).prop("checked", !$(this).prop("checked")); }); });
被选中的值代码: 橘子1 香蕉1 西瓜1 芒果1 葡萄1