Continuously adding new chat messages will show the latest one, but eventually it stops scrolling down automatically. How do I resolve this issue? Thank you.
$("#button1").click(function(){
$("<div>").html("text").appendTo("#chat1");
$('#chat1').scrollTop($('#chat1').height())
});