[Javascript] Scroll a multiline textarea

Aaron Bassett aaronbassett at gmail.com
Mon Oct 30 07:44:11 CST 2006


function scrollToBottom(el) {
    el.scrollTop=el.scrollHeight;
}

will make the textarea jump to the last line - could probably do with more
work and only tested in FF2 win
but hopefully will set you on the right track.

cheers



On 10/30/06, John Warner <john at jwarner.com> wrote:
>
> Is there a way to scroll a textarea using Javascript, what I want to do
> is scroll the text without the user taking action with the mouse. Say I
> have a text area sized to show say 5 lines of text but actually contains
> say 25 lines of text, can I either style or using JS cause the text area
> to scroll to the bottom? Any ideas on how?
>
> Thanks
>
> John Warner
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20061030/2d6b442d/attachment.htm>


More information about the Javascript mailing list