Add RELEASE-NOTES for r93818 and r94155. Adding to the 1.18 file since they're tagged...
[mediawiki.git] / resources / jquery / jquery.getAttrs.js
blobc05012d97d118d863975f6747009f12ef86ccb41
1 /**
2  * Utility to get all attributes of an element directy as an object.
3  *
4  * @author Timo Tijhof, 2011
5  */
6 jQuery.fn.getAttrs = function( all ) {
7         var     map = this[0].attributes,
8                 attrs = {},
9                 len = map.length,
10                 i, v;
12         for ( i = 0; i < len; i++ ) {
13                 // IE6 includes *all* allowed attributes for thew element (including those
14                 // not set). Those have values like undefined, null, 0, false, "" or "inherit".
15                 // However there may be genuine attributes set to that. If you need them,
16                 // set all to true. They are excluded by default.
17                 v = map[i].nodeValue;
18                 if ( all || ( v && v !== 'inherit' ) ) {
19                         attrs[ map[i].nodeName ] = v;
20                 }
21         }
23         return attrs;