I used
var items = document.getElementById('messageBody');
items.scrollTo(0, document.getElementById('messageBody').scrollHeight);
where, 'messageBody' is the id of the div with height 400px and vertical scroll in it. This seems to be working fine in Chrome browser but its not working in Firefox. Can someone help me with a fix for this issue in Firefox browser?