如何在循环中将数据存储在数组中?
var images;
var i = 0;
$('#cover div').each(function()
{
alert($(this).attr('id'));
//I should store id in an array
});
<div id="cover">
<div id="slider_1"><p class="content">SLIDER ONE</p></div>
<div id="slider_2"><p class="content">SLIDER TWO</p></div>
<div id="slider_3"><p class="content">SLIDER THREE</p></div>
</div>