Auto-expanding textarea
<p>I'm trying to do a simple auto-expanding textarea. This is my code:</p>

<pre><code>textarea.onkeyup = function () {
  textarea.style.height = textarea.clientHeight + 'px';
}
</code></pre>

<p>But the textarea just keeps growing indefinitely as you type... </p>

<p>I know there is Dojo and a jQuery plugin for this, but would rather not have to use them. I looked at their implementation, and was initially using <code>scrollHeight</code> but that did the same thing. </p>

<p>You can start answering and play with the textarea for your answer to play with. </p>
