<!-- textarea rows attribute -->
<textarea id="txtid" name="txtname" rows="4" cols="50" maxlength="200">
A nice day is a nice day.
Lao Tseu
</textarea>
<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>
$('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';
});
ele.scrollHeight (Height of text inside scroll inlduing what u cant see)
ele.clientHeight (What u see)
Code Example |
---|
Html :: iframe adjust pdf zoom |
Html :: html make background black |
Html :: confuse your browser in html |
Html :: bootstrap flex align |
Html :: script src tag in html |
Html :: adding mp4 in html |
Html :: favicon not showing up |
Html :: html skype |
Html :: href disable underline |
Html :: fafa login icons html code |
Html :: source sans pro html code |
Html :: js making input non typeable |
Html :: href rel |
Html :: minimal acceptable html |
Html :: css border table none |
Html :: uninstall xampp linux |
Html :: *ngFor index |
Html :: html mail |
Html :: html input color picker |
Html :: sendgrid mail api disable tracker |
Html :: html viewport meta tag |
Html :: select gender html |
Html :: tailwind |
Html :: otp not getting recognised in safari react |
Html :: codewithmarley |
Html :: pass method to composite jsf component |
Html :: bootstrap Badges Contextual variations |
Html :: show timestamp as yyyy mm dd html angular |
Html :: ayoaduwo |
Html :: make text blue html |