I am trying to disable all unchecked checkboxes when there are 5 checked checkboxes.
My code is not working here it is: http://jsfiddle.net/mtYtW/18/
My Jquery:
$("table input[type=checkbox]").click(function(){ var countchecked = $("table input[type=checkbox]:checked").length; if(countchecked >= 5) { $("table input:checkbox").attr("disabled", true); }else{ } });
Working example: http://jsfiddle.net/Re5uy/6/