Answers for "set height of textarea according to content css"

2

get height of text in textarea

ele.scrollHeight (Height of text inside scroll inlduing what u cant see)
ele.clientHeight (What u see)
Posted by: Guest on September-05-2021
1

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

Code answers related to "set height of textarea according to content css"

Browse Popular Code Answers by Language