My problem seems like a common one. I've searched on the web and cannot find an answer to my problem. Basically, I'm updating the contents of a textbox using php. The problem is that when the text is being updated it does not autoscroll down so that users can see the new content. My php script runs through a loop and new content is being added. While the new content is being added to the text box successfully - the textbox does not automatically scroll down and/or flow with the new content. I've been told that Javascript can solve this problem. Here is an overview of what I'm trying to do: <div id="divExample" style="width: 315px; height: 200px; overflow:auto; border: 2px solid black;"> <?PHP MY PHP CODE LOOPING AND ECHOING RESULTS?> </div> Code (markup): And this is what I think needs to be done in order to continuously ensure that the textbox scrolls to the bottom as new output arrives: function scrollCheck() { var chatBox = document.getElementById('divExample'); var top = chatBox.scrollTop; var height = chatBox.scrollHeight - 150; var returnText; if ((top == height) || (height < 20)) { return true; } else { return false; } } <div id="divExample" style="width: 315px; height: 200px; overflow:auto; border: 2px solid black;"> <?PHP MY PHP CODE LOOPING AND ECHOING RESULTS Call the scrollCheck function ?> </div> Code (markup): Am I on the right track? Does anyone know of a working similar example? Would there be a more effective way to accomplish this?