Answers for "how to auto resize textarea"

12

disable textarea resize

textarea {   /* for all text* area elements */
  resize: none;
}

#foo {                  /* for particular id */
  resize: none;
}
Posted by: Guest on July-06-2020
1

textarea scale to content

<textarea rows="10" style="font-size: 2vw; width:100%;"></textarea>
Posted by: Guest on July-04-2020
0

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';
});
Posted by: Guest on June-03-2020

Browse Popular Code Answers by Language