Auto Grow Textarea Vertically To Fit Content - textAdjust

File Size: 15.9 GB
Views Total: 1466
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Auto Grow Textarea Vertically To Fit Content - textAdjust

textAdjust is a small yet customizable jQuery auto grow plugin for textarea element that automatically adjusts the height of your textarea to fit the content while typing.

How to use it:

1. Create a normal textarea element and specify the min/max number of rows using the HTML5 data attributes:

<textarea id="example"

2. Download the plugin and import the JavaScript jquery.textAdjust.js after jQuery (slim build).

<script src="" 
<script src="jquery.textAdjust.js"></script>

3. Call the function textAdjust on the textarea element and the plugin will do the rest.




4. You can also specify the min/max number of rows to shrink/expand in the JavaScript.

  min: 2,
  max: 10

5. Sometimes you might need to destroy the plugin.


6. Available event handlers.

  .on('textAdjust.grow', function(event, oldRows, newRows){
    // on grow
  .on('textAdjust.shrink', function(event, oldRows, newRows){
    // on shrink
  .on('textAdjust.nochange', function(event, oldRows, newRows){
    // when no change
  .on('textAdjust.init', function(event){
    // on init
  .on('textAdjust.destroy', function(event){
    // on destroy

This awesome jQuery plugin is developed by onuo. For more Advanced Usages, please check the demo page or visit the official website.