Since the DOM tree of the page is active and always displayed in the browser, how can you best change this DOM tree for any purpose without affecting the actual rendered tree? Let's say my goal is to swap some of the child nodes and see how similar the DOM tree remains.
Does a duplicate tree create a single solution? If so, is there a function for this? Or I need to write my own function to create a duplicate copy of the tree. I do not need all the attributes of the element element, so I can create a simpler object with several attributes pointing to siblings and children.
source share