Class: Node
This object will be used as the prototype for Nodes when creating a DOM-Level-1-compliant structure.
Constructors
constructor
• new Node()
Properties
endIndex
• endIndex: null
| number
The end index of the node. Requires withEndIndices
on the handler to be `true.
Defined in
node_modules/domhandler/lib/node.d.ts:39
next
• next: null
| ChildNode
Next sibling
Defined in
node_modules/domhandler/lib/node.d.ts:35
nodeType
• Readonly
Abstract
nodeType: number
DOM spec-compatible node type.
Defined in
node_modules/domhandler/lib/node.d.ts:50
parent
• parent: null
| ParentNode
Parent of the node
Defined in
node_modules/domhandler/lib/node.d.ts:31
prev
• prev: null
| ChildNode
Previous sibling
Defined in
node_modules/domhandler/lib/node.d.ts:33
sourceCodeLocation
• Optional
sourceCodeLocation: null
| SourceCodeLocation
parse5
source code location info.
Available if parsing with parse5 and location info is enabled.
Defined in
node_modules/domhandler/lib/node.d.ts:45
startIndex
• startIndex: null
| number
The start index of the node. Requires withStartIndices
on the handler to be `true.
Defined in
node_modules/domhandler/lib/node.d.ts:37
type
• Readonly
Abstract
type: ElementType
The type of the node.
Defined in
node_modules/domhandler/lib/node.d.ts:29
Accessors
nextSibling
• get
nextSibling(): null
| ChildNode
Same as next. DOM spec-compatible alias.
Returns
null
| ChildNode
Defined in
node_modules/domhandler/lib/node.d.ts:67
• set
nextSibling(next
): void
Parameters
Name | Type |
---|---|
next | null | ChildNode |
Returns
void
Defined in
node_modules/domhandler/lib/node.d.ts:68
parentNode
• get
parentNode(): null
| ParentNode
Same as parent. DOM spec-compatible alias.
Returns
null
| ParentNode
Defined in
node_modules/domhandler/lib/node.d.ts:55
• set
parentNode(parent
): void
Parameters
Name | Type |
---|---|
parent | null | ParentNode |
Returns
void
Defined in
node_modules/domhandler/lib/node.d.ts:56
previousSibling
• get
previousSibling(): null
| ChildNode
Same as prev. DOM spec-compatible alias.
Returns
null
| ChildNode
Defined in
node_modules/domhandler/lib/node.d.ts:61
• set
previousSibling(prev
): void
Parameters
Name | Type |
---|---|
prev | null | ChildNode |
Returns
void
Defined in
node_modules/domhandler/lib/node.d.ts:62
Methods
cloneNode
▸ cloneNode<T
>(this
, recursive?
): T
Clone this node, and optionally its children.
Type parameters
Name | Type |
---|---|
T | extends Node <T > |
Parameters
Name | Type | Description |
---|---|---|
this | T | - |
recursive? | boolean | Clone child nodes as well. |
Returns
T
A clone of the node.
Defined in
node_modules/domhandler/lib/node.d.ts:75