title: Jquery change method and bulk class adding
body: <p>Hello
  I have a table (with class name ".data") with it's thead holding a single checkbox for selecting / deselecting all checkboxes inside my tbody.</p>
  
  <p>Also each checkbox inside the tbody can be selected invidually and once a checkbox is selected, it adds a new class to the selected row(for making background some other color for highlighting).</p>
  
  <p>Now for this I have written such methods:</p>
  
  <pre><code> function enableBulkCheckbox(){
       $(".checkall").change(function(){
          if ($(this).is(':checked')){
              $(".data input:checkbox").attr('checked', true);
          }
          else{
              $(".data input:checkbox").attr('checked', false);
          }
      });
  }
  
  function selectMark(box){
      if ($(box).is(':checked')){
          $(box).parent().parent().addClass("selected");
      }
      else{
          $(box).parent().parent().removeClass("selected");
      }
  };
  
  function applySelectMark(){
       $(".data tbody input:checkbox").change(function(){
          selectMark(this);
          alert("hooo");
      });
  };
  </code></pre>
  
  <p>and I init enableBulkCheckbox() and</p>
  
  <p>It seems like <code>$(".data tbody input:checkbox").change</code> cannot recognize if <code>enableBulkCheckbox()</code> is triggered. However selecting/deselecting all via the mass select checkbox works as expceted. How can this be solved so that once I click bulk checkbox, all rows can get the "selected" class.</p>