The Element.replaceChildren() method replaces the existing children of a Node with a specified new set of children. These can be string or Node objects.
Element.replaceChildren()
external void replaceChildren(JSAny nodes);