D
dbsmilr
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.getElementById("myXml");
alert(xmlDoc.hasChildNodes);
</script>
</html>
But that doesn't work, it says document.getElementById("xmlXml") 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.getElementById("myXml");
alert(xmlDoc.hasChildNodes);
</script>
</html>
But that doesn't work, it says document.getElementById("xmlXml") has
no properties. How do I do a scenario like this? Thanks!