Skip to main content

Class: Comment

@headstartwp/core.Comment

Comments within the document.

Hierarchy

  • DataNode

    Comment

Constructors

constructor

new Comment(data)

Parameters

NameTypeDescription
datastringThe content of the data node

Inherited from

DataNode.constructor

Defined in

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

Properties

data

data: string

Inherited from

DataNode.data

Defined in

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


endIndex

endIndex: null | number

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

Inherited from

DataNode.endIndex

Defined in

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


next

next: null | ChildNode

Next sibling

Inherited from

DataNode.next

Defined in

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


parent

parent: null | ParentNode

Parent of the node

Inherited from

DataNode.parent

Defined in

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


prev

prev: null | ChildNode

Previous sibling

Inherited from

DataNode.prev

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.

Inherited from

DataNode.sourceCodeLocation

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.

Inherited from

DataNode.startIndex

Defined in

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


type

type: Comment

Overrides

DataNode.type

Defined in

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

Accessors

nextSibling

get nextSibling(): null | ChildNode

Same as next. DOM spec-compatible alias.

Returns

null | ChildNode

Inherited from

DataNode.nextSibling

Defined in

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

set nextSibling(next): void

Parameters

NameType
nextnull | ChildNode

Returns

void

Inherited from

DataNode.nextSibling

Defined in

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


nodeType

get nodeType(): 8

Returns

8

Overrides

DataNode.nodeType

Defined in

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


nodeValue

get nodeValue(): string

Same as data. DOM spec-compatible alias.

Returns

string

Inherited from

DataNode.nodeValue

Defined in

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

set nodeValue(data): void

Parameters

NameType
datastring

Returns

void

Inherited from

DataNode.nodeValue

Defined in

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


parentNode

get parentNode(): null | ParentNode

Same as parent. DOM spec-compatible alias.

Returns

null | ParentNode

Inherited from

DataNode.parentNode

Defined in

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

set parentNode(parent): void

Parameters

NameType
parentnull | ParentNode

Returns

void

Inherited from

DataNode.parentNode

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

Inherited from

DataNode.previousSibling

Defined in

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

set previousSibling(prev): void

Parameters

NameType
prevnull | ChildNode

Returns

void

Inherited from

DataNode.previousSibling

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

NameType
Textends Node<T>

Parameters

NameTypeDescription
thisT-
recursive?booleanClone child nodes as well.

Returns

T

A clone of the node.

Inherited from

DataNode.cloneNode

Defined in

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