以下为使用JQuery获取input checkbox被选中的值代码: 橘子1 香蕉1 西瓜1 芒果1 葡萄1
实现全选反选 注意用:prop
// 全选 $('#allcheck').click(function(){ $('input[name="check"]').prop('checked','true'); }); //反选 $('#reversecheck').click(function(){ $('input[name="check"]').each(function () { $(this).prop("checked", !$(this).prop("checked")); }); });