xxxxxxxxxx
<!-- textarea rows attribute -->
<textarea id="txtid" name="txtname" rows="4" cols="50" maxlength="200">
A nice day is a nice day.
Lao Tseu
</textarea>
xxxxxxxxxx
<label for="story">Tell us your story:</label>
<textarea id="story" name="story"
rows="5" cols="33">
It was a dark and stormy night
</textarea>
xxxxxxxxxx
$('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';
});
xxxxxxxxxx
ele.scrollHeight (Height of text inside scroll inlduing what u cant see)
ele.clientHeight (What u see)