Get every element values from class selector
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1258676/get-attribute-values-as-array-from-selection-of-elements-using-jquery">Get attribute values as array from selection of elements using jQuery</a>  </p>
</blockquote>



<p>I am trying to get the id from the list of elements</p>

<p>I have</p>

<pre><code>&lt;div class='test' id='123'&gt; &lt;/div&gt;
&lt;div class='test' id='1243'&gt; &lt;/div&gt;

&lt;div class='test' id='1223'&gt; &lt;/div&gt;
&lt;div class='test' id='1423'&gt; &lt;/div&gt;
&lt;div class='test' id='1223'&gt; &lt;/div&gt;
&lt;div class='test' id='1253'&gt; &lt;/div&gt;
</code></pre>

<p>I want to get id for every div</p>

<p>I have</p>

<pre><code>var idarray=[];

var id= $('.test').attr('id'); //would only get the first 123 id.

idarray.push(id)
</code></pre>

<p>How to I get every id to the idarray in my case? Thanks for the help</p>
