jQuery: input text remaining chars counter
<p>I'm trying to write a simple remaining chars counter for my backoffice <code>input</code> texts with <code>jQuery</code> but it doesn't work:</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function(){

function text_counter (input_text, target) {
    var max = $(input_text).attr("maxlength");
    $(input_text).keydown (function () {
        var timer = setTimeout (function () {
            var text = $(input_text).text();
            var current = text.length;
            $(target).text(current + "/" + max);
        }, 1);
    });
}               
text_counter ("#description", "#description_counter");

});
&lt;/script&gt;

&lt;input id="description" type="text" maxlength="250" value="Default text"&gt;
&lt;span id="description_counter"&gt;&lt;/span&gt;
</code></pre>

<p>If I start to write inside the <code>input</code>, the <code>span</code> element change in <code>12/250</code> and freeze here (12 == "Default text".length).</p>

<p>Where I'm wrong?</p>
