Using keyup to count characters in jQuery
<p>I completely understand the method of using <code>.bind('keyup', function() { });</code> to count characters in a <code>textarea</code> or <code>input</code>, but I've attempted to do a <code>keydown</code> function so you can see the results AS you're typing, versuses, holding down a letter on your keyboard and the count not updating until AFTER you've released the key.</p>

<pre><code>var input = $('textarea#input');
$('span#character-count').text(input.val().length);

input.bind('keydown', function() {
    $('span#character-count').text(input.val().length + 1);
});
</code></pre>

<p>My current method is flawed:</p>

<ul>
<li>when you select all and hit delete, the count is messed up.</li>
<li>it requires +1 to show a live view</li>
</ul>

<p><strong>jsFiddle:</strong> <a href="http://jsfiddle.net/rdvR7/" rel="nofollow">http://jsfiddle.net/rdvR7/</a></p>
