textarea height control with content js code example
Example 1: textarea only one line
textarea {
resize: none;
white-space: nowrap;
overflow-x: scroll; /* or hidden */
}
Example 2: html textarea auto height to amount of text
$('textarea').each(function () {
this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
}).on('input', function () {
this.style.height = 'auto';
this.style.height = (this.scrollHeight) + 'px';
});