Document
Hierarchy
- NodeWithChildren
- Document
Index
Constructors
constructor
Properties
publicchildren
Children of the node. Only certain node types can have children.
endIndex
The end index of the node. Requires withEndIndices
on the handler to be `true.
next
Next sibling
parent
Parent of the node
prev
Previous sibling
optionalsourceCodeLocation
parse5
source code location info.
Available if parsing with parse5 and location info is enabled.
startIndex
The start index of the node. Requires withStartIndices
on the handler to be `true.
type
The type of the node.
optionalx-mode
Document mode (parse5 only).
Accessors
childNodes
close
firstChild
First child of the node.
Returns null | ChildNode
lastChild
Last child of the node.
Returns null | ChildNode
loc
nextSibling
nodeType
DOM spec-compatible node type.
Returns 9
open
parentNode
Same as parent. DOM spec-compatible alias.
Returns null | ParentNode
Parameters
parent: null | ParentNode
Returns void
previousSibling
Methods
cloneNode
Clone this node, and optionally its children.
Type parameters
- T: Node
Parameters
this: T
recursive: boolean = false
Clone child nodes as well.
Returns T
A clone of the node.
The root node of the document.