Merge "MediaTransformOutput: Allow <img> alt value to be "0""
[lhc/web/wiklou.git] / resources / src / jquery / jquery.getAttrs.js
1 /**
2 * @class jQuery.plugin.getAttrs
3 */
4
5 /**
6 * Get the attributes of an element directy as a plain object.
7 *
8 * If there is more than one element in the collection, similar to most other jQuery getter methods,
9 * this will use the first element in the collection.
10 *
11 * @return {Object}
12 */
13 jQuery.fn.getAttrs = function () {
14 var i,
15 map = this[0].attributes,
16 attrs = {},
17 len = map.length;
18
19 for ( i = 0; i < len; i++ ) {
20 attrs[ map[i].name ] = map[i].value;
21 }
22
23 return attrs;
24 };
25
26 /**
27 * @class jQuery
28 * @mixins jQuery.plugin.getAttrs
29 */