Dynamically expand height of input type “text” based on number of characters typed into field

后端 未结 3 1261
遇见更好的自我
遇见更好的自我 2020-12-01 10:26

Similar to the below JSFiddle (which I bookmarked and do not know from where the original question emerged):

http://jsfiddle.net/mJMpw/6/



        
3条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 10:44

    UPDATED[2]:

    As scrollHeight is always equal to height, we have to set height to '1' before scrollHeight, then when we delete characters the