I have an XML document that res开发者_开发问答embles -
<Results>
<Data>
<div id = 'id_div1'>
<b>Hello World!</b>
</div>
</Data>
</Results>
Knowing that my HTML is contained within the 'Data' element, using JavaScript how can I get
<div id = 'id_div1'><b>Hello World!</b></div> ?
-snip-
Edit
it's a lot simpler than all this...
xmlDoc=loadXMLDoc("myxml.xml");
var html = xmlDoc.getElementsByTagName("Data")[0].getElementsByTagName("div")[0]
document.body.appendChild(html);
精彩评论