get list of all attributes jqery

Solutions on MaxInterview for get list of all attributes jqery by the best coders in the world

showing results for - "get list of all attributes jqery"
Andrea
02 Feb 2016
1function getAttributes ( node ) {
2    var i,
3        attributeNodes = node.attributes,
4        length = attributeNodes.length,
5        attrs = {};
6
7    for ( i = 0; i < length; i++ ) attrs[attributeNodes[i].name] = attributeNodes[i].value;
8    return attrs;
9}