Reputation: 1499
I have a div element inside my php script, <div id="abc"></div>
however it contains some other div elements as well.What this div element look like is
<div id="abc">
<div>
//some content
</div>
</div>
I am using jquery ajax to .append()
some returned html content inside the abc div
but what it does is that it simply appends the response html content to the abc div
. Obviously the name says so ,what i wanna know it that is there any function like which replaces all the content inside, by the returned content instead of appending to it ?
Upvotes: 0
Views: 518
Reputation: 43
If i got you right
$('#abc').html(result);
should do the trick. It will just replace the content of your abc-div.
Upvotes: 1