var arraysOfIds = $('#particularDivId img').map(function(){ return this.id; }).get(); // arraysOfIds has now all the id's,access it as arraysOfIds[0],arraysOfIds[1]....