title: jQuery trigger('click') not firing .click event on checkbox
body: <p>I have table with a check-all checkbox in the header which checks all the checkboxes in that column of the table: </p>
  
  <pre><code>&lt;input class="check-all" type="checkbox" id="masterCheck" /&gt;
  </code></pre>
  
  <p>However, on one of my pages I would like to automatically check the check-all checkbox on page load.</p>
  
  <p>To do this I've attempted to fire a trigger('click') function like the one below:</p>
  
  <pre><code>$(document).ready(function () {
      if ($("#masterCheck").attr('checked')) {
      } else {
          $("#masterCheck").trigger('click');
      }
  });
  </code></pre>
  
  <p>This checks the checkbox fine, but doesn't fire my custom click event for checkboxes with the class <strong>.check-all</strong> (below):</p>
  
  <pre><code>$(function () {
      $('.check-all').click(function () {
          $(this).parents('table:eq(0)').find(':checkbox').attr('checked', this.checked);
      });
  });
  </code></pre>
  
  <p>I've also tried adding a Javascript setTimeout, thinking that the custom click function wasn't being loaded quite yet, but it still didn't fire the custom click function after waiting 1, 2, and 3 seconds.</p>
  
  <p>Upon page load, I can then un-check my pre-checked checkbox and re-check it to check all of the checkboxes in the column perfectly.</p>
  
  <p>Do I have to add something special to my jQuery on the Document.ready to allow it to fire the custom click event? </p>
  
  <p>***EDIT1:</p>
  
  <p>Ok, I've attempted to add the custom click event right above the document.ready function on my page to ensure it's loaded (as the previous custom click event  is in a master .js file used in my _Layout). In addition to this, I've changed the class of my checkbox to correspond with my new custom click event so I don't conflict with the one in my master .js file.</p>
  
  <pre><code>&lt;input class="check-allx" type="checkbox" id="masterCheck" /&gt;
  
  
  // Check all checkboxes when the one in a table head is checked:
      $(function () { 
          $('.check-allx').click(function () {
              $(this).parents('table:eq(0)').find(':checkbox').attr('checked', this.checked);
              alert(this);
          });
      });
  // Check for unchecked masterCheck
      $(document).ready(function () {
          if ($("#masterCheck").attr('checked')) {
          } else {
              //$("#masterCheck").trigger('click');
              $("#masterCheck").click();
          }
      });
  </code></pre>
  
  <p>This seems to throw my alert within the custom click event which is progress, but to no avail do all my checkboxes check like they should. Note: I've also changed the trigger('click') to a .click(), which both do the same thing in my situation.</p>