After the AJAX request, an XML file is returned. I can parse this file, but when it comes to getting the "innerHTML" (or in this case "innerXML") element, a problem arises.
If the XML element, say, “content”, contains only text that I could do: content.childNodes[0].nodeValue (assuming the content refers to the XML element “content”). But this element contains other elements:
<stackoverflow reason="tribute to this page"> <content> <div><span><p>Some more HTML elements</p></span></div> </content> </stackoverflow>
I need to copy the contents of <content> into an existing <div> in the page, how can I do this?
Ex. myDiv.innerHTML = content.innerHTML;
source share