How do I use jQuery to return the class of each checked checkbox as they are checked?
<p>I am using jQuery for the first time (my js knowledge is poor at best) and attempting to create a Section filter (hides/shows divs depending on class) that is based around checkbox options.</p>

<p>To start with I was wanting to retrieve the class of each checkbox that was checked so I have something like this (the div.text is just to test the output). Each checkbox class corresponds to the class of the div (all div's have multiple classes that match various checkboxes)</p>

<pre><code>&lt;ul&gt;
    &lt;li&gt;Size&lt;/li&gt;
    &lt;li&gt;&lt;input type="checkbox" class="half" /&gt;&amp;frac12;"&lt;/li&gt;
    &lt;li&gt;&lt;input type="checkbox" class="quart" /&gt;&amp;frac34;"&lt;/li&gt;
&lt;/ul&gt;

&lt;script&gt;
    function Checked() {
        var n = $("input:checked").attr("class");
        $("div.text").text(n);
    }

    Checked();
    $(":checkbox").click(Checked);
&lt;/script&gt;
</code></pre>

<p>This succesfully returns the first checked checkbox class, I toyed around with each() but don't quite understand how to implement it, can someone point me in the right direction please?</p>

<p>Ultimately I'm looking for each checked checkbox class to be in an array that I can then call upon to make the corresponding divs the only visible items, but I'm happy to take this a step at a time. I'm sure this is likely to be an easier way to achieve the desired result so am also open to suggestions. Thanks in advance</p>
