問題があります。チェックボックスがあります。一度に選択したいのですが、カウント結果が間違っています。Firefox、Operaを使用している場合は問題ありませんが、crome、safari、IEを使用している場合は、間違った結果になります。なぜ?私を助けてください。
http://jsfiddle.net/Taslimkhan/kdEmH/2/
ここで設定したコード:
// add multiple select / deselect functionality
$("#selectall").click(function () {
$('.case').attr('checked', this.checked);
});
// if all checkbox are selected, check the selectall checkbox
// and viceversa
$(".case").click(function(){
if($(".case").length == $(".case:checked").length) {
$("#selectall").attr("checked", "checked");
} else {
$("#selectall").removeAttr("checked");
}
});
});
$(document).ready(function () {
$("input[type=checkbox]").each(function () {
$(this).change(updateCount);
});
updateCount();
function updateCount () {
var count = $("input[type=checkbox]:checked").size();
$("#count").text(count);
$("#status").toggle(count > 0);
};
});