Skip to content

Instantly share code, notes, and snippets.

@oranj
Created February 20, 2013 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oranj/4999833 to your computer and use it in GitHub Desktop.
Save oranj/4999833 to your computer and use it in GitHub Desktop.
Lets you get a list of values of the provided attributes.
$.prototype.attrs = function(attr) {
var o = [];
$(this).each(function() {
var v = $(this).attr(attr);
if (v) {
o.push(v);
}
});
return o;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment