Created
July 10, 2016 18:20
-
-
Save mavitm/ced729fa7107204ba8f7d615704d7ab8 to your computer and use it in GitHub Desktop.
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
;(function($,undefined){ | |
"use strict"; | |
$.fn.getAttributes = function () { | |
var elem = this, | |
attr = {}; | |
if(elem && elem.length) { | |
$.each(elem.get(0).attributes, function( v, n ) { | |
n = n.nodeName || n.name; | |
v = elem.attr(n); | |
if( v != undefined && v !== false ) attr[n] = v; | |
}); | |
} | |
return attr | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment