Getting class name from div
<p>I want to retrieve the class name of the last child element (class last div <code>new3</code>) in <code>.find_class</code>, but my code gives me class <code>select3</code>. How can I fix it?</p>

<p><strong>Demo:</strong> <a href="http://jsfiddle.net/gBxan/5/" rel="nofollow">http://jsfiddle.net/gBxan/5/</a></p>

<pre><code>&lt;div class="find_class mediumCell"&gt;
    &lt;div class="new1 old1"&gt;
        &lt;div class="select1"&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="new2 old2"&gt;
        &lt;div class="select2"&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="new3 old3"&gt;&lt;!-- I want to get this div's class name 'new3' --&gt;
        &lt;div class="select3"&gt;&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;

var find = $('div.find_class div:last').attr('class');
alert(find);
</code></pre>
