title: How to dynamically filter content using checkboxes? - jQuery
body: <p>I am trying to dynamically filter out content using checkboxes and jquery.</p>
  
  <p>Being new to jquery, I'm not sure on how to do this properly, so if any can help that would be great.</p>
  
  <p>I have got this code:</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" &gt;
          $(document).ready(function(){
              $("#test").change(function()
              {    
                  if ($(this).is(":checked"))
                  {
                          $("#example").hide();
  
                  }else{
                          $("#example").show();
                  }
  
              });
          });
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;input type="checkbox" id="test"/&gt;
      &lt;input type="checkbox" id="test2"/&gt;
  
      &lt;div id="example"&gt;Example&lt;/div&gt;
      &lt;div id="example2"&gt;Example2&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I am trying to make it so that both checkboxes work dynamically, meaning that I don't have to hard code the id in like above, which only works for the first checkbox. I want to have multiple checkboxes so was wondering how to do this. Do I get the id on check and insert somehow?</p>
  
  <p>Any help would be great, thanks.</p>