This feature is experimental. It may be changed or removed in a future version without prior notice or deprecation.
Replaces the given old element with the given new element.
The old element will be removed from the DOM tree.
If you don't need IE11 support you may also use the built-in
Element#replaceWith() to the same effect.