Interesting thought - wouldn't that prepend a new span block every time the
contents changed though?  



Matt Grimm-2 wrote:
> 
> What about this (untested):
> 
> 
> $('textarea').change( function() 
> {
>       $(this).prepend('Current length:&nbsp;<span id="' + this.id +
> '_len">' + this.value.length + '</span>&nbsp;characters');
> 
>       $('#' + this.id + '_len').css('color', (( this.value.length >
> parseInt( this.id.split()[1] )) ? 'red' : 'green')).html(
> this.value.length ) 
> }); 
> 
> 
> There's probably a chainable way to grab that new span id after the
> prepend fcn, but as I said, untested...
> 
> m.
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Textarea-character-count-tf3062230.html#a8526118
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to