问题描述:

Is there a way 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];
}
相关阅读:
Top