All we need to do is just increase the height if the text input is beyond the height of the textarea.
We can do that using JavaScript scrollheight method.
Here’s another post on scrollHeight.
How to get the height and width of an element using JavaScript?
jQuery Solution
Check the demo out:
JavaScript Solution
We can access the textarea elements using Tag Name
Checkout the demo:
There are plenty of other ways to do it as you can see in these answers on StackOverflow.
elements input scrollHeight textarea