function replaceNode(newNode, oldNode) {
  const parent = oldNode.parentNode;
  if (parent) {
    parent.replaceChild(newNode, oldNode);
  }
}
@param {Node} newNode Node to replace old node
@param {Node} oldNode The node to be replaced