All we need to do is just increase the height if the text input is beyond the height of the textarea.
Here’s another post on scrollHeight.
Check the demo out:
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