jQuery.autoResize

Auto-Resizing Textareas for Zepto/jQuery 1.7+

View project onGitHub

jQuery.autoResize

autoResize is a plugin for auto-resizing textareas, expanding them to fit the text as you type.

It's based on a clean and simple technique that uses the scrollHeight style property, and doesn't create additional elements, as opposed to other plugins.

Usage

It can be used either directly on an element, or indirectly on a container.

Direct binding

$("textarea").autoResize();

Delegated binding

$.autoResize("textarea");

Which is equivalent to:

$(document).autoResize("textarea");

Further reading

Expanding textareas the easy and clean way by George Papadakis