Skip to main content

Class: Comment

Defined in: node_modules/domhandler/lib/node.d.ts:103

Comments within the document.

Extends​

  • DataNode

Constructors​

Constructor​

new Comment(data): Comment

Defined in: node_modules/domhandler/lib/node.d.ts:85

Parameters​

data​

string

The content of the data node

Returns​

Comment

Inherited from​

DataNode.constructor

Properties​

data​

data: string

Defined in: node_modules/domhandler/lib/node.d.ts:81

Inherited from​

DataNode.data


endIndex​

endIndex: null | number

Defined in: node_modules/domhandler/lib/node.d.ts:39

The end index of the node. Requires withEndIndices on the handler to be `true.

Inherited from​

DataNode.endIndex


next​

next: null | ChildNode

Defined in: node_modules/domhandler/lib/node.d.ts:35

Next sibling

Inherited from​

DataNode.next


parent​

parent: null | ParentNode

Defined in: node_modules/domhandler/lib/node.d.ts:31

Parent of the node

Inherited from​

DataNode.parent


prev​

prev: null | ChildNode

Defined in: node_modules/domhandler/lib/node.d.ts:33

Previous sibling

Inherited from​

DataNode.prev


sourceCodeLocation?​

optional sourceCodeLocation: null | SourceCodeLocation

Defined in: node_modules/domhandler/lib/node.d.ts:45

parse5 source code location info.

Available if parsing with parse5 and location info is enabled.

Inherited from​

DataNode.sourceCodeLocation


startIndex​

startIndex: null | number

Defined in: node_modules/domhandler/lib/node.d.ts:37

The start index of the node. Requires withStartIndices on the handler to be `true.

Inherited from​

DataNode.startIndex


type​

type: Comment

Defined in: node_modules/domhandler/lib/node.d.ts:104

The type of the node.

Overrides​

DataNode.type

Accessors​

nextSibling​

Get Signature​

get nextSibling(): null | ChildNode

Defined in: node_modules/domhandler/lib/node.d.ts:67

Same as next. DOM spec-compatible alias.

Returns​

null | ChildNode

Set Signature​

set nextSibling(next): void

Defined in: node_modules/domhandler/lib/node.d.ts:68

Parameters​
next​

null | ChildNode

Returns​

void

Inherited from​

DataNode.nextSibling


nodeType​

Get Signature​

get nodeType(): 8

Defined in: node_modules/domhandler/lib/node.d.ts:105

DOM spec-compatible node type.

Returns​

8

Overrides​

DataNode.nodeType


nodeValue​

Get Signature​

get nodeValue(): string

Defined in: node_modules/domhandler/lib/node.d.ts:90

Same as data. DOM spec-compatible alias.

Returns​

string

Set Signature​

set nodeValue(data): void

Defined in: node_modules/domhandler/lib/node.d.ts:91

Parameters​
data​

string

Returns​

void

Inherited from​

DataNode.nodeValue


parentNode​

Get Signature​

get parentNode(): null | ParentNode

Defined in: node_modules/domhandler/lib/node.d.ts:55

Same as parent. DOM spec-compatible alias.

Returns​

null | ParentNode

Set Signature​

set parentNode(parent): void

Defined in: node_modules/domhandler/lib/node.d.ts:56

Parameters​
parent​

null | ParentNode

Returns​

void

Inherited from​

DataNode.parentNode


previousSibling​

Get Signature​

get previousSibling(): null | ChildNode

Defined in: node_modules/domhandler/lib/node.d.ts:61

Same as prev. DOM spec-compatible alias.

Returns​

null | ChildNode

Set Signature​

set previousSibling(prev): void

Defined in: node_modules/domhandler/lib/node.d.ts:62

Parameters​
prev​

null | ChildNode

Returns​

void

Inherited from​

DataNode.previousSibling

Methods​

cloneNode()​

cloneNode<T>(this, recursive?): T

Defined in: node_modules/domhandler/lib/node.d.ts:75

Clone this node, and optionally its children.

Type Parameters​

T​

T extends Node

Parameters​

this​

T

recursive?​

boolean

Clone child nodes as well.

Returns​

T

A clone of the node.

Inherited from​

DataNode.cloneNode