Created
August 19, 2012 20:23
-
-
Save tejastank/3397454 to your computer and use it in GitHub Desktop.
JQuery getAttributes() plugin/Feature Implementation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Tejas Tank. | |
/// [email protected] | |
(function($) { | |
$.fn.getAttributes = function() { | |
var attributes = {}; | |
if(!this.length) | |
return this; | |
$.each(this[0].attributes, function(index, attr) { | |
attributes[attr.name] = attr.value; | |
}); | |
return attributes; | |
} | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment