Filter content using checkboxes & JQuery
<p>I'm having problems making this code work:</p>

<pre><code>    $(function(){
        $('div.tags').delegate('input:checkbox', 'change', function() {
            var $lis = $('.results &gt; li').hide();
            //For each one checked
            $('input:checked').each(function() {
                    $lis.filter('.' + $(this).attr('rel')).show();
            });
        });
    });
</code></pre>

<p>With HTML like:</p>

<pre><code>      &lt;div class="tags"&gt;
        &lt;label&gt;&lt;input type="checkbox" rel="arts" /&gt; Arts &lt;/label&gt;
        &lt;label&gt;&lt;input type="checkbox" rel="computers" /&gt; Computers &lt;/label&gt;
        &lt;label&gt;&lt;input type="checkbox" rel="health" /&gt; Health &lt;/label&gt;
        &lt;label&gt;&lt;input type="checkbox" rel="video-games" /&gt; Video Games &lt;/label&gt;
      &lt;/div&gt;
      &lt;ul class="results"&gt;
         &lt;li class="arts computers"&gt;Result 1&lt;/li&gt;
         &lt;li class="video-games"&gt;Result 2&lt;/li&gt;
         &lt;li class="computers health video-games"&gt;Result 3&lt;/li&gt;
         &lt;li class="arts video-games"&gt;Result 4&lt;/li&gt;
      &lt;/ul&gt;
</code></pre>

<p>I've tried it in IE, FF &amp; Opera, but I don't get expected results. That is, the content is not being filtered upon clicking a checkbox? I'm trying to replicate something similar to this: </p>

<p><a href="http://www.houseoffraser.co.uk/Jeans+for+Women/302,default,sc.html" rel="nofollow">http://www.houseoffraser.co.uk/Jeans+for+Women/302,default,sc.html</a></p>

<p>Notice the accordian effect on the left side bar of the page. I'm not too worried about the accordian itself, it's the checkboxes function that I'm focusing on at the moment. On page load, all query results (some 1300 or so), are displayed to the user. </p>

<p>A user can then filter or refine the results by clicking on checkboxes. I'm assuming this is some kind of Jquery/Ajax script, but am not entirely sure? Am I on the right track?</p>

<p>Thanks in advance. </p>
