How do I make an expanding textbox?

前端 未结 3 1845
情话喂你
情话喂你 2021-02-04 18:50

I want to make a textbook where it starts out as a given width/height. Then if users type more then the given amount of space, the textbox expands downward. How do I go about do

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-04 19:32

    You can add a library if you care to, or just keep track of the textarea's scrollTop property.

    If scrollTop is not zero, add your rows.

     
     
     
     
    Expand textarea  
    
    
     
    
     
     
     
    

提交回复
热议问题