Help Needed with scrollHeight please

I’m having a heck of a time figuring this out. I’ve been researching for the past few hours with now luck. I’m not too familiar with javascript. I have a php script that echos out text within a CSS box. The problem is autoscrolling while the text is being put into the box. I’ve tried several examples online and none of them work. Most of the solutions are for <textarea>, which is not the way I’m doing things.

I think I’m on the right track within this code:

<script language="javascript" type="text/javascript">

This being a short example of my CSS text-area:

<div id="divExample" style="width: 315px; height: 200px; overflow:auto; border: 2px solid black;">



I have played with the CSS overflow style and have not had any success. If anyone has any suggestions I would greatly appreciate it.

Here’s an exact example of what I need…

Correct, php cannot do this. I’ve been told that Javascript can. As the text is sent to the text box I need to have the textbox autoscroll with the new text instead of remaining at the top. Yes, it is being done every few seconds - that being said I suppose the javascript function needs to be called everytime. However, this seems way too complicated for something so simple.

I’m giving up at this point.

I don’t see how a PHP script could do this, as it operates on the server side. Do you mean that you want the box to be scrolled down a certain distance by default when the page is loaded? If this is somehow being done every few seconds or something like that, then you need to be performing your javascript every time this happens, as it won’t update itself automatically. However, it’s hard to tell what you want to do without any more code or an example.