Created
January 31, 2017 23:04
-
-
Save dustinpoissant/b26a677ad21d761fe36fe76a23b74ed7 to your computer and use it in GitHub Desktop.
Revisions
-
dustinpoissant created this gist
Jan 31, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ $.fn.attrs = function(){ var attributes = {}; if(this.length){ $.each( this[0].attributes, function( index, attr ) { attributes[ attr.name ] = attr.value; }); } return attributes; }; This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ $.fn.attrs=function(){var a={};return this.length&&$.each(this[0].attributes,function(b,c){a[c.name]=c.value}),a};