我正在尝试收集一个扇区中的 id 列表(数组)
<div id="mydiv">
<span id='span1'>
<span id='span2'>
</div>
$("#mydiv").find("span");
给我一个 jQuery 对象,但不是一个真正的数组;
我可以
var array = jQuery.makeArray($("#mydiv").find("span"));
然后使用 for 循环将 id 属性放入另一个数组
或者我可以
$("#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)
无论如何,我只是想看看 jQuery 中是否有一个速记来做到这一点;