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.
It can be used either directly on an element, or indirectly on a container.
$("textarea").autoResize();
$.autoResize("textarea");
Which is equivalent to:
$(document).autoResize("textarea");
Expanding textareas the easy and clean way by George Papadakis