get the class of all the element inside the div
<p>Ok. I want to get all the class names of a div inside the main div.</p>

<p>How to do it that to get all the class of div that inside in a div??</p>

<p>for example:</p>

<pre><code>&lt;div id="themaindiv"&gt;
    &lt;div class="div1"&gt;&lt;/div&gt;
    &lt;div class="div2"&gt;&lt;/div&gt;
    &lt;div class="div3"&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>now, i want to get all the class names of all the div which is inside the div named "themaindiv" but i just dont know how to done it.</p>

<p>update: and then display those class names which been hook by the function into the specified div ('#theclassnames').</p>

<p>example of the result that should be.</p>

<pre><code>&lt;div id="theclassnames"&gt;div1 div2 div3 div4&lt;/div&gt;
</code></pre>

<p>thanks in advance.</p>
