jQuery.fn.collect
jQuery.fn.collect
I think I saw the method, I'm not sure if it was in prototype,
mootools or some other framework... That I think it's a very common
task to perform, and it's pretty short to make it a plugin... it's to
map over the matched elements and collect an attribute from each. I
checked prototype, but it's collect method is equal to jQuery's map,
so I don't know. The method would be like this:
$.fn.collect = function( attr ){
return this.map(function(){
return this[attr];
});
};
I was thinking maybe it could be useful to include it in the core, it
may save some bytes...
Just a thought..
Ariel Flesler