1 $(document).ready(function(){
2 // count character on keyup
5 var currentLength = $("#status_textarea").val().length;
6 var remaining = 140 - currentLength;
7 var counter = $("#counter");
8 counter.text(remaining);
11 counter.attr("class", "toomuch");
13 counter.attr("class", "");
17 if ($("#status_textarea").length) {
18 $("#status_textarea").bind("keyup", counter);
19 // run once in case there's something in there