How can I set the scroll bar of the textarea control to the bottom and bottom?

Source: Internet
Author: User

After a function adds content to the texterea control, how does it move its scroll bar to the bottom?

1st Floor
Does anyone know?

2nd floor
<Textarea name = "textarea" cols = "80" rows = "10" style = "overflow-y: hidden; overflow-x: scroll;"> </textarea>

Third floor
<Body>
<Textarea rows = 10 cols = 20 id = "oTextarea"> ksaljdf
Fffffffff
Ffffff
Ffffff
Ffffffff
Fffff
Fffffffff
Fffffffff
Ffffffffff
Ffffffffff
Fffffffff
Fffffffff </textarea>
<Br>
<Input type = "button" value = "set" onclick = "oTextarea. scrollTop = oTextarea. scrollHeight">

4th floor
// You can also move the cursor.
<Script>
Function setCursor (){
Range = document. all. demo. createTextRange (); // The demo is the id of textarea.
Range. collapse (false );
Range. moveStart ('character ', 0 );
Range. select ();
}
</Script>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.