jQuery Get Class Name
<p>I'm trying to get the class name from an selection of images when clicked.</p>

<p>The code below retrieves the first images class name but when I click on my other images with different class values they display the first images class.</p>

<p>How can I get each images class value?</p>

<p>HTML</p>

<pre><code>&lt;a href="#" title="{title}" class="bg"&gt;&lt;img src="{image:url:small}" alt="{title}" class="{image:url:large}" /&gt;&lt;/a&gt;
</code></pre>

<p>jQuery Code</p>

<pre><code>    $(".bg").click(function(){
        var1 = $('.bg img').attr('class');
</code></pre>
