...

View Full Version : Can I scroll a textarea without using the scrollbar?



carlwenrich
10-12-2008, 04:56 AM
I'm adding text elements to a textarea using the "document.getElementById('the_id').value += whatever;" statement in my javascript code. When it gets to the bottom the scrollbar appears, but the new text is added off screen (at the bottom). Is there a way to automatically scroll as I add more text?

rangana
10-12-2008, 05:45 AM
var el=document.getElementById('the_id');
el.scrollTop=el.scrollHeight;

carlwenrich
10-12-2008, 06:04 AM
Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum