javascript beginner- how to obtain class for a div or other html node
<p>In a web page there is a div with a value specified for its class.</p>

<p>Now, I have with me the node corresponding to the div, how do I obtain the class of that div, using the node (which is stored in a js variable)?</p>

<p>Example--</p>

<pre><code>&lt;div class="test" id="div1"&gt;
Some random text
&lt;/div&gt;
</code></pre>

<p>How do I obtain the class value (i.e. "test")  when I have with me the node that represents the above div?</p>
