Since: 8.4

interface ChildNode (View source)

This is the modern, spec-compliant equivalent of DOMChildNode.

Methods

void
remove()

Removes the node

void
before(Node|string ...$nodes)

Adds nodes before the node

void
after(Node|string ...$nodes)

Adds nodes after the node

void
replaceWith(Node|string ...$nodes)

Replaces the node with new nodes

Details

void remove()

Removes the node

Return Value

void

No value is returned.

void before(Node|string ...$nodes)

Adds nodes before the node

Adds the passed nodes before the node.

Parameters

Node|string ...$nodes

Nodes to be added before the node. Strings are automatically converted to text nodes.

Return Value

void

No value is returned.

void after(Node|string ...$nodes)

Adds nodes after the node

Adds the passed nodes after the node.

Parameters

Node|string ...$nodes

Nodes to be added after the node. Strings are automatically converted to text nodes.

Return Value

void

No value is returned.

void replaceWith(Node|string ...$nodes)

Replaces the node with new nodes

Parameters

Node|string ...$nodes

The replacement nodes. Strings are automatically converted to text nodes.

Return Value

void

No value is returned.