HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

replaceWith

Description

The replaceWith of ChildNode for JS replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

Syntax

node.replaceWith(...nodes)

Parameters

nodes

Objects that implement Node. Nodes participate in a tree, which is known as the node tree.

Examples

1 · text

2 · text

3 · element · single

4 · element · multiple

5 · for · text

6 · for · element · single

7 · for · element · multiple