reading XML attributes in javascript

后端 未结 2 1459
囚心锁ツ
囚心锁ツ 2021-01-24 16:22

Guess it\'s a simple question for a javascript guru, but i\'m learning and got a problem I can\'t guess out.

I\'m interested in reading an XML file using javascript. He

2条回答
  •  一生所求
    2021-01-24 16:25

    In, this case, since the attribute elements you are looking for are direct children of the object element, a simple thing you can do is iterate through the child elements of the object element by hand:

    var obj = objList[0]
    var childNodes = obj.childNodes
    for(var i=0; i

    For information on these and other DOM methods, I recommend checking out the documentation over on MDN.

提交回复
热议问题