Possible Duplicate:
Get attribute values as array from selection of elements using jQuery
I am trying to get the id from the list of elements
I have
<div class='test' id='123'> </div>
<div class='test' id='1243'> </div>
<div class='test' id='1223'> </div>
<div class='test' id='1423'> </div>
<div class='test' id='1223'> </div>
<div class='test' id='1253'> </div>
I want to get id for every div
I have
var idarray=[];
var id= $('.test').attr('id'); //would only get the first 123 id.
idarray.push(id)
How to I get every id to the idarray in my case? Thanks for the help
id, it is not valid HTML.