How do I set textarea scroll bar to bottom as a default?

后端 未结 4 1175
执念已碎
执念已碎 2020-12-02 08:32

I have a textarea that is being dynamically reloaded as user input is being sent in. It refreshes itself every couple seconds. When the amount of text in this textarea excee

4条回答
  •  温柔的废话
    2020-12-02 08:56

    In your HTML ...

    
    

    In your Javascript ...

    
    

    I have found that you need to put the code to set the scrollHeight into a separate function after loading the new value into the text area.

提交回复
热议问题