2
rated 0 times
[
9]
[
7]
/ answers: 1 / hits: 132668
/ 15 Years ago, tue, may 5, 2009, 12:00:00
I am trying to gather a list (array) of ids in a sector
<div id=mydiv>
<span id='span1'>
<span id='span2'>
</div>
$(#mydiv).find(span);
gives me a jQuery object, but not a real array;
I can do
var array = jQuery.makeArray($(#mydiv).find(span));
and then use a for loop to put the id attributes into another array
or I can do
$(#mydiv).find(span).each(function(){}); //but i cannot really get the id and assign it to an array that is not with in the scope?(or can I)
Anyhow, I just wanna see if there is a shorthand in jQuery to do that;
More From » jquery