This is what I want to do:
<html>
<xml id="myXml">
<book title="book1" />
<book title="book2" />
</xml>
<div id="out"><!-- I would output the xml formatted nicely for the
user in this div</div>
<script type="text/javascript">
var xmlDoc = document.getEle mentById("myXml ");
alert(xmlDoc.ha sChildNodes);
</script>
</html>
But that doesn't work, it says document.getEle mentById("xmlXm l") has
no properties. How do I do a scenario like this? Thanks!
<html>
<xml id="myXml">
<book title="book1" />
<book title="book2" />
</xml>
<div id="out"><!-- I would output the xml formatted nicely for the
user in this div</div>
<script type="text/javascript">
var xmlDoc = document.getEle mentById("myXml ");
alert(xmlDoc.ha sChildNodes);
</script>
</html>
But that doesn't work, it says document.getEle mentById("xmlXm l") has
no properties. How do I do a scenario like this? Thanks!
Comment