CSS:
.chatWindow{
background-color:#CCCCCC;
color:#000099;
width:52%;
height:150px;
overflow:auto;----------------------------------->I hv set this as auto from scroll
border: 3px solid #000000;
padding:10px;
margin-top:10px;
margin-left:-5%;
margin-right:0%;
float:left;
}
the function:
function loadMessages(content){
document.getElementById("chatWindow").innerHTML = content;
document.getElementById("chatWindow").scrollIntoView(false);
}