There are numerous divs similar to this one, all created via ajax.
.done(function( response ) {
$("#stores").html('');
var iterator = response.retailer;
for (var i=0;i<iterator.length;i++){
$("#stores").html($("#stores").html()+
"<div id="+response.retailer[i].id+" class='panel panel-default '>"+
"<div class='panel-body'>"+
"<p> Name: "+response.retailer[i].name+"<p>"+
"<p> Address: "+response.retailer[i].address+"<p>"+
" <button id='AddAndSave' class='btn btn-success col-md-offset-10'><span class='glyphicon glyphicon-plus'></span></button>"+
"</div>"+
"</div>");
}
})
Within the div is a button. When this button is clicked, I aim to extract all content of that specific div and store it as variables. How can this be achieved? Are there any references available?