19 lines
No EOL
460 B
JavaScript
Executable file
19 lines
No EOL
460 B
JavaScript
Executable file
(function(old) {
|
|
$.fn.attr = function() {
|
|
if(arguments.length === 0) {
|
|
if(this.length === 0) {
|
|
return null;
|
|
}
|
|
|
|
var obj = {};
|
|
$.each(this[0].attributes, function() {
|
|
if(this.specified) {
|
|
obj[this.name] = this.value;
|
|
}
|
|
});
|
|
return obj;
|
|
}
|
|
|
|
return old.apply(this, arguments);
|
|
};
|
|
})($.fn.attr); |