I am running a code
<div id="#1gr1">Kun</div>
for(var i=1;i<=10;i++){
$.ajax({
type: "POST",
url: "get_url.php",
async: false,
data: {a: 'hi'}
}).done(function(msg) {
// getting msg[1]='Good';
if (msg !== '') {
$('#1gr' + i).html(msg[1]);
}
msg='';
});
}
It is changing html of #1gr1 temporarily to "Good"
<div id="#1gr1">Good</div>
but at next call when i=2;it is changing text of #1gr1 to back "KUN".
and this time changing html for #1gr2
<div id="#1gr1">Kun</div>
<div id="#1gr2">Good</div>
MAIN PROBLEM:Why text of div automatically changing back to original text,Value of i as exactly what i want.
Any Guess..?