I have got a problem. I have some checkbox. I want to select them at once, but counting result is wrong. when If I use firefox, opera then ok but when i use crome,safari, IE then It gives me a wrong result. why? please help me.
http://jsfiddle.net/Taslimkhan/kdEmH/2/
some code I have set here:
// 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);
};
});