if it is a chat box with a form
at bottom, you can set focus
on one of the form
element or the last text generated in your chat box.:
http://codepen.io/gc-nomade/pen/CztIx/
onload= function() {
frmfcs =document.getElementById('form1');
frmfcs.focus();
}
The attribute autofocus would have been an option if it was cross browser : here one of my old test : http://dabblet.com/gist/5271266