before

The before JS ChildNode inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.

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

Syntax

node.before(...nodes)

Parameters

nodes

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

Examples

1

2

3

4

after

remove

replaceWith

Web Hypertext Application Technology Working Group (WHATWG)

Home Menu