jQuery checkbox check/uncheck

The Solution to jQuery checkbox check/uncheck is

Use .prop() instead and if we go with your code then compare like this:

Look at the example jsbin:

  $("#news_list tr").click(function () {
    var ele = $(this).find(':checkbox');
    if ($(':checked').length) {
      ele.prop('checked', false);
    } else {
      ele.prop('checked', true);


  1. Changed input to :checkbox.
  2. Comparing the length of the checked checkboxes.

~ Answered on 2013-02-08 10:03:13

Most Viewed Questions: