2 * @class jQuery.plugin.getAttrs
5 function serializeControls( controls
) {
6 var i
, data
= {}, len
= controls
.length
;
8 for ( i
= 0; i
< len
; i
++ ) {
9 data
[ controls
[i
].name
] = controls
[i
].value
;
16 * Get the attributes of an element directy as a plain object.
18 * If there is more than one element in the collection, similar to most other jQuery getter methods,
19 * this will use the first element in the collection.
23 jQuery
.fn
.getAttrs = function () {
24 return serializeControls( this[0].attributes
);
28 * Get form data as a plain object mapping form control names to their values.
32 jQuery
.fn
.serializeObject = function () {
33 return serializeControls( this.serializeArray() );
38 * @mixins jQuery.plugin.getAttrs