Good catch, Jörn!
You don't even need the explicit loop:jQuery.fn.attrs = function(key, val) { if (val != undefined) return this.attr(key, val); var a = []; this.each(function() { a.push($(this).attr(key)); }); return a; };
Good catch, Jörn!
You don't even need the explicit loop:jQuery.fn.attrs = function(key, val) { if (val != undefined) return this.attr(key, val); var a = []; this.each(function() { a.push($(this).attr(key)); }); return a; };