How can i change a reference to an element in javascript?

dzgn

New Member
I would like to modify an element of my xml. I have to query it to find it, and then I only seem to be able to modify a copy of it. I use: \[code\]clientXML.querySelector("[id=XMLIssue-9]").childNodes[2].textContent;\[/code\] to isolate the element in question.I would like to just replace the element with this one \[code\]newXMLIssue.childNodes[0]\[/code\]. They both have the exact same structure. I cant do:\[code\]clientXML.querySelector("[id=XMLIssue-9]") = newXMLIssue.childNodes[0];\[/code\]because it causes an error to have the function on the left side of the equation. I also tried:\[code\]var x = clientXML.querySelector("[id=XMLIssue-9]"); x = newXMLIssue.childNodes[0];\[/code\]but this only changes a copy of the element.
 
Back
Top