replaceChildren

replaceChildren replaces all the children of the node with nodes, while replacing the strings in the nodes with equivalent text nodes.

Syntax

node.replaceChildren(nodes)

Examples

1

2

3

4

Internal

append

children

firstElementChild

lastElementChild

prepend

querySelector

querySelectorAll

External

Web Hypertext Application Technology Working Group (WHATWG)

Home Menu