title: Determine if a checkbox is checked using jquery on page load
body: <p>I am still pretty new to jQuery, so forgive me if this doesn't make sense the first round.</p>
  
  <p>I have a set of checkboxes (allowed, not allowed, negotiable), that if you check allowed or negotiable it unhides another set of checkboxes via the onclick event.</p>
  
  <p>The problem I am having is that when the page is refreshed, I want the second set of checkboxes to be visible if allowed or negotiable are checked. I'd like this to be done on page load, not through any click or change events if possible.</p>
  
  <p>I have tried various suggestions to other issues with no luck.
  eg: <code>if ($("#id_pets_0").attr("checked")==true)</code></p>
  
  <p>Is this possible?</p>
  
  <p>If anyone has any alternatives to this, I'm game for that as well.</p>
  
  <p><strong>UPDATE:</strong>
  This is what I have been attempting.</p>
  
  <pre><code>$(function() {
     if ($("#id_pets_0").attr("checked")==true) {
          $("#dogs").show();
          $("#cats").show();
      }
      else {
          $("#dogs").hide();
          $("#cats").hide();
      }
  });
  </code></pre>
  
  <p><strong>UPDATE:</strong>
  This code does work. So I know that it is checking the checkboxes for the click events at least.</p>
  
  <pre><code>$(function() {
      $('input#id_pets_0').click(function() {
      if ($(this).attr("checked")) {
          $("#id_pets_1").attr("checked", false);
          $("#dogs").show("slow");
          $("#cats").show("slow");
          return;
      }
      if ($("#id_pets_2").attr("checked")) {
          $("#dogs").show("slow");
          $("#cats").show("slow");
      }
      else {
          $("#id_dogs_0").attr("checked", false);
          $("#id_dogs_2").attr("checked", false);
          $("#id_cats_0").attr("checked", false);
          $("#id_cats_2").attr("checked", false);
          $("#dogs").hide("slow");
          $("#cats").hide("slow");
      }
  });
  });
  </code></pre>