Answers for "how to set textarea height depending value inside it"

2

html textarea height

<!-- textarea rows attribute -->
<textarea id="txtid" name="txtname" rows="4" cols="50" maxlength="200">
A nice day is a nice day.
Lao Tseu
</textarea>
Posted by: Guest on April-05-2021
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

Code answers related to "how to set textarea height depending value inside it"

Browse Popular Code Answers by Language