以下のコードでは、動的に生成されたdivの内部htmlを変更しようとすると、内部htmlが変更されます。
$.ajax({
url: 'xxx.xxx',
beforeSend: function() {
$('#scroll_items').append('<div class="list_item more_content" align="center"><img src="loader.gif"></div>');
},
success: function(data) {
$('#scroll_items div:last').html("hai to all");
}
});
html部分
<div id="scroll_items">
<div class="list_item1">
Scroll beyond this container to automatically load more content
</div>
<div class="list_item">
[ List Item 2 ]
</div>
</div>
</div>