> Is there a way to just return the jquery object (so I could
> see it in firebug's watch section) then pass it to another
> jquery function then join them all up when I know
> everything works?
>
> $('#test :textarea').before('Current length: <span id="'+
this.id +'_len">'+this.value.length+'</span> characters').keypress(
function()
> {
> $('#'+this.id + '_len').css('color', ((this.value.length >
parseInt(this.id.split()[1]))?'red':'green')).html(this.value.length)
> });
Yes, breaking up your chains is one of the first things do do when you're
having trouble. For example:
var $test = $('#test :textarea');
$test.before('Current length: <span id="'+ this.id
+'_len">'+this.value.length+'</span> characters');
$test.keypress( function() {
var $len = $('#'+this.id + '_len');
$len.css('color', ((this.value.length >
parseInt(this.id.split()[1]))?'red':'green'));
$len.html(this.value.length);
});
Now you'll find it easier to debug.
-Mike
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/