Node.new()

Create a new detached node of the given type.

Usage

Source

Node.new(node_type)

The node is not part of any tree. Use mutation methods (append_child(), insert_before(), etc.) to attach it.

Parameters

node_type: NodeType
The type of node to create.

Returns

Node
A new detached node.