Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Can I scroll a textarea without using the scrollbar?

    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?

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Code:
    var el=document.getElementById('the_id');
    el.scrollTop=el.scrollHeight;
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • Users who have thanked rangana for this post:

    carlwenrich (10-12-2008)

  • #3
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •