autoResize is the simplest jQuery Textarea resize plugin that automatically increases and decreases the height of your textarea to suit its content.
It works perfectly with most CSS frameworks like Bootstrap, Bulma, TailwindCSS, etc.
How to make use of it:
1. Include the autoResize.js
plugin after loading the newest jQuery library.
<script src="/path/to/cdn/jquery.slim.min.js"></script> <script src="/path/to/Jquery.autoResize.js"></script>
2. Or instantly insert the next JS snippets into your undertaking.
$.fn.autoResize = function(){ let r = e => { e.style.height = ''; e.style.height = e.scrollHeight + 'px' }; return this.each((i,e) => { e.style.overflow = 'hidden'; r(e); $(e).bind('input', e => { r(e.target); }) }) };
3. Call the function autoResize
in your textarea and performed it.
$('textarea').autoResize();
Auto Stretch Textarea To Fit Its Content, autoResize Plugin/Github
See Demo And Download
Official Website(gdrone): Click Here
This superior jQuery/javascript plugin is developed by gdrone. For extra advanced usage, please go to the official website.