Click to See Complete Forum and Search --> : xpath javascript how


alhazred666
09-08-2005, 07:54 AM
I have following xml:
<root>
<node id="1" type="1" /></node>
<node id="2" type="2" /></node>
</root>
How find id and type in javascript (crossbrowser example need) ?

Khalid Ali
09-13-2005, 12:05 AM
u can use standard dom methods such as
document.getElementsByTagName("node");
The above will return a nodelist, you can access each node just as you would an array item, then you can get the attribute value for each attribute...