Quantcast
Viewing latest article 1
Browse Latest Browse All 4

Answer by user16590017 for How to auto-size a textarea in height?

Try this and enjoy:

var textarea = document.getElementById("YourTextArea");var limit = 50; //height limittextarea.oninput = function() {  textarea.style.height = "";  textarea.style.height = Math.min(textarea.scrollHeight, limit) +"px";};
textarea {    width: 99%;}
<textarea id="YourTextArea"></textarea>

Viewing latest article 1
Browse Latest Browse All 4

Trending Articles