title: jQuery update DOM and have change() method run
body: <p>I've got a bunch of checkboxes that I want to have trigger a callback when their state is toggled, so I added this (working) line:</p>
  
  <pre><code>$('.main').change(mainChecked);
  </code></pre>
  
  <p>And then in the mainChecked method I look at the 'this' variable and do the appropriate thing whether it was checked or not.  Now, elsewhere in my code I want to check some of those so I just did:</p>
  
  <pre><code>$('[data-auto-select]').attr('checked', 'checked');
  </code></pre>
  
  <p>My problem is that while they do get checked, the mainChecked() function doesn't get called for them.  How do I check them in such a way that the mainChecked() method also automatically gets called?</p>