In my page i have a div id=”result” and this div already contain data.
Then i have a ajax call to retrieve loop data.
$.each(data, function(name, value) {
document.write(value.email);
});
// i tried .html("#result") but not working.
How can i place these loop data into the div id=”result” and replaced the previous content.
I think, as you’re loop over data, it seems you’ve multiple emeil addressess. So you can make a string of all loop data (email) and then set that as
html()to#request, instead of appending to#resultwithin loop again and again..html()will replace previous data and update that#requestcontent with new result.