Forum Moderators: open
document.getElementByTagname(TAG NAME IN QUOTES).attributes.getNamedItem(ATTRIBUTE NAME IN QUOTES).value;
I know its a pain with the DOM, but it works for me.
For example:
For XML <person name="Bruce">, your javascript would be:
document.getElementByTagname("person").attributes.getNamedItem("name").value;
I tried it on my machine and it works :)
Bruce
Here is what I have:
<script type="text/javascript" for="window" event="onload">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("note2.xml")
to.innerText=document.getElementByTagname("person").attributes.getNamedItem("name").text;
</script>
XML File (note2.xml):
<person name="Todd" />
I am just trying to get the name to display in the webpage, any help would be greatly appreciated, thanks again for your help.