The new switchElementsAlt switch method throws a DOMException for me when trying to copy <head> attributes:
DOMException: Failed to execute 'setNamedItem' on 'NamedNodeMap': The node provided is an attribute node that is already an attribute of another Element; attribute nodes must be explicitly cloned.
Cloning the attribute node before setting it on oldEl when switching resolves this issue.
The new
switchElementsAlt
switch method throws aDOMException
for me when trying to copy<head>
attributes:DOMException: Failed to execute 'setNamedItem' on 'NamedNodeMap': The node provided is an attribute node that is already an attribute of another Element; attribute nodes must be explicitly cloned.
Cloning the attribute node before setting it on
oldEl
when switching resolves this issue.