<script><br />
      $("textarea").each(function () {<br />
      this.setAttribute("style", "height:" + (this.scrollHeight) + "px;overflow-y:hidden;");<br />
    }).on("input", function () {<br />
      this.style.height = "auto";<br />
      this.style.height = (this.scrollHeight) + "px";<br />
    });<br />
    </script>