开发者

Loop through all attributes of an xml node

开发者 https://www.devze.com 2023-03-27 10:19 出处:网络
Is there a w开发者_运维技巧ay with JavaScript to loop through all attributes of a given 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];
}
0

精彩评论

暂无评论...
验证码 换一张
取 消