Reputation: 395
I need to read an xml node in javascript, just if a certain attr has a specific value. Is there any way without using a loop? I mean something like:
x = xml.getElementsByTagName("someXmlTag")[someAttr=someValue];
Upvotes: 1
Views: 1740
Reputation: 1
This works in firefox
var x = xml.querySelector('someXmlTag[someAttr=someValue]');
YMMV with other browsers
Upvotes: 2