Triggering jquery event function at page load
<p>Here's a little jQuery function that does what I want when a checkbox is clicked, but I have a basic gap in my knowledge: </p>

<p>How to register this so that it deals with checkboxes that are already clicked when the page loads? </p>

<p>(<strong>Edit:</strong> Sorry, to those who already answered the question, but i've edited this to make it more clear)</p>

<pre><code>$(document).ready(function() {
  $('fieldset input:checkbox').click(function() {
    if ($(this).attr('name') == 'foo') {
      if ($(this).attr('checked')) {
        // hide checkbox 'bar'
      }
      else {
        // show checkbox 'bar'
      }
    }
  }
});
</code></pre>

<p>If I use .trigger('click'), it clicks (or unclicks) all the boxes on page load.</p>

<p>I can think of a few ways to do this that would involve repeating portions of the code, but I just know that jQuery already has an elegant answer for this...</p>
