Inside myordersdiv, I have all this below div's appended to it .
<div data-role="collapsible">
<div class="prd-items-detials">
<ul>
<li class="head">
<form><label class="testtt" for="checkbox-mini-0">' + itemname + '</label></form>
</li>
<li class="prd-items-qt">
<div class="col"><span class="prd-sm-img"><img id="imagesd" type="img" height="40" width="40" src="' + image + '"/><span></div>
<div class="col"><i class="minus" id_attr="' + id_attr_val + '"></i><i class="qt qt_' + id_attr_val + '" id_attr="' + id_attr_val + '">1</i><i class="plus" id_attr="' + id_attr_val + '"></i></div>
<div class="col"><a href="#" class="btn btn-sm">Topping</a></div>
<div style="display: none;" class="price" id_attr="' + id_attr_val + '">' + price + '</div>
<div class="col total total_' + id_attr_val + '" id_attr="' + id_attr_val + '">' + price + '</div>
</li>
</ul>
</div>
</div>
HTML Section .
<div id="myordersdiv">
</div>
On click of a Confirm Order Button , I need to get all the images and its corresponding quantity and price present in that div , in below format
var divdata = '{"data": [{"name": "JSON_images/popcorn.jpg","quan":"1","price":"50"},{"name": "JSON_images/icecream_cup.jpg","quan":"2","price":"100"}]}';
Right now i am able to get all the images present under that div .
$(document).on("click", ".btn-confirmorder", function () {
var imagedata = $("#myordersdiv").find('img').map(function(){
return $(this).attr('src')
}).get()
The screen look this way .

I have seen this logic for creating an JSON array:
var divdata = {
data: []
};
for(var i in someData) {
var item = someData[i];
divdata.data.push({
"image" : item.firstName,
"price" : item.lastName,
"quantity" : item.age
});
}
please tell me how can i do all this under the listener ??