How can I get a particular element with JavaScript if there are many with same class?
<p>I have this code. How can I get <code>'a'</code> of <code>'div1'</code>:</p>

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

<p>Thanks for help. Just started learning JavaScript.</p>