title: How to auto expand textarea as we write
body: <p>How can I auto expand my text area as I write? </p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
                  function clearContents(element) {
                    element.value = '';
                  }
                  function updateContents(element) {
                    element.value = "What's on your mind?";
                  }
              &lt;/script&gt;
              &lt;h1&gt;New status&lt;/h1&gt;
              &lt;form action="index.php" method="post" name="new_message"&gt;
                  &lt;textarea id="message" onFocus="clearContents(this);" onKeyPress="catchEnter(this);"&gt;What's on your mind?&lt;/textarea&gt;
                  &lt;input type="button" value="Post"&gt; 
              &lt;/form&gt;
  </code></pre>