title: Change height of textarea based on number of lines of text in javascript
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7477/autosizing-textarea-using-prototype">Autosizing textarea using prototype</a>  </p>
  </blockquote>
  
  
  
  <p>How do I change the height of a text area based on the number of lines of text that the user puts into it?</p>
  
  <p>For the example below if the user changed the text in the textarea to more than one line of text then the textarea would put a scroll bar on itself rather than changing its height to fit the number of lines.</p>
  
  <pre><code>&lt;textarea&gt;
  This is the default text that will be displayed in the browser. When you change this text and add more lines to it the browser will not change the height of the textarea that this text is in rather it will add a scroll bar, which is not what I want.
  &lt;textarea&gt;
  </code></pre>