VoltzRoad
VoltzRoad

Reputation: 495

How can I navigate the DOM for the contents of an XML object

I have an XML file, and I would like to extract the contents of a tag called issueId. I have tried

alert(myXML.getElementsByTagName("issueId")[0]);

and I get a box saying [object element] I also tried

I however cannot extract the data "12345" itself! I have tried

alert(myXML.getElementsByTagName("issueId")[0].nodeValue);

and I get "null". How can I just get the contents of this object?

Upvotes: 0

Views: 43

Answers (1)

freejosh
freejosh

Reputation: 11383

Try myXML.getElementsByTagName("issueId")[0].textContent

Upvotes: 1

Related Questions