html checkbox全选或者全不选
/* 全选或全不选 */ function CheckedAllOrNo() { var arr = $(':checkbox'); for (var i = 1; i < arr.length; i++) { arr[i].checked = arr[0].checked; } }
实现checked单选
$(":checkbox").click(function(){ $(":checkbox").each(function() { this.checked = false; }); this.checked = true; });