Jquery limit for to enter character not work for IE/Chrome/safari
<p>I have used the following jquery code to show how many character is left to type in textarea its work fine on all browser.<br>
but when i use backspace and delete some character then its show how many character left fine on Mozilla but its not work for IE,Chrome,safari.</p>

<p>This is the demo link: <a href="http://jsfiddle.net/ckWNM/" rel="nofollow">http://jsfiddle.net/ckWNM/</a></p>

<pre><code>jQuery(document).ready(function($) {
    var max = 10;
    $('textarea.max').keypress(function(e) {
        $("#counter").html("characters left : " +(10 - this.value.length));
        if (e.which &lt; 0x20) {
            return;   
        }
        if (this.value.length == max) {
            e.preventDefault();
        } else if (this.value.length &gt; max) {
            // Maximum exceeded
            this.value = this.value.substring(0, max);
        }
    });
}); //end if ready(fn)
</code></pre>
