Jquery - Read all Classes from a div
<p><br />
i try to read all classes.</p>

<p><strong>HTML</strong></p>

<pre><code>&lt;div id="test" class="fff aaa ccc" &gt;hello world&lt;/div&gt;
</code></pre>

<p><strong>JS</strong></p>

<pre><code>if ($('#test').attr('class') != '')
{
   // Read classes
    var all_classes = $('#test').attr('class');

    // Output
    $('body').append('Classnames: '+all_classes+' ');

}
</code></pre>

<p><strong>Example</strong>
<a href="http://www.jsfiddle.net/AQgqU/8/" rel="nofollow">http://www.jsfiddle.net/AQgqU/8/</a></p>

<p>Can somebody help me?</p>

<p>Thanks in advance!<br />
Peter</p>
