title: Countdown available spaces in a textarea with jquery or other?
body: <p>I have a few areas on my site where I need to limit text input to X amount of characters and it's nice to show a number of spaces left while a user types in, like twitter does.</p>
  
  <p>I found this jquery plugin;
  <a href="http://remysharp.com/2008/06/30/maxlength-plugin/" rel="noreferrer">jquery max-length plugin</a></p>
  
  <p>It does just what I need but it seems kind of like overkill, I am not sure the filesize but it looks like a lot of lines of code for such a simple task, do you think I would be better off using a non-jquery method?  The reason I was thinking jquery was the way to go is because jquery is already included into all my pages
  <strong>UPDATE;</strong></p>
  
  <p>I just found this non-jquery method that does the exact same thing is is way smaller footprint, so would this be the better method?</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
  function limitText(limitField, limitCount, limitNum) {
     if (limitField.value.length &gt; limitNum) {
      limitField.value = limitField.value.substring(0, limitNum);
     } else {
      limitCount.value = limitNum - limitField.value.length;
     }
  }
  &lt;/script&gt;
  
  You have 
  &lt;input readonly type="text" name="countdown" size="3" value="1000"&gt;
  characters left.
  </code></pre>