Loop through all attributes of an xml node
Is there a w开发者_运维技巧ay with JavaScript to loop through all attributes of a given xml node?
I am hoping that there's a simple method that doesn't involve calling a library (jQuery or other).
You can use the attributes
collection.
for (var i=0; i<node.attributes.length; i++)
{
var attrib = node.attributes[i];
}
精彩评论