$() returns the selection; it does not return the actual resulting object (although in practice it simply returns a list of actual objects). If you want to change the property of the .value object, you can do this:
$('.abc').each(function(){ this.value += foo; });
If you like, you can create functions that work with selections, for example .add() , which can be implemented as follows:
jQuery.fn.extend({ add: function(k,v) { this[k](this[k]()+v); } });
which can then be used as follows:
$('.abc').add('val', foo);
... but I don't think this is better than using $().each()
geocar Aug 03 '09 at 19:35 2009-08-03 19:35
source share