Skip to main content

abstractNode

This object will be used as the prototype for Nodes when creating a DOM-Level-1-compliant structure.

Hierarchy

Index

Constructors

constructor

Properties

children

children: Node[] = []

endIndex

endIndex: null | number = null

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

next

next: null | ChildNode = null

Next sibling

abstractreadonlynodeType

nodeType: number

DOM spec-compatible node type.

parent

parent: null | ParentNode = null

Parent of the node

prev

prev: null | ChildNode = null

Previous sibling

optionalsourceCodeLocation

sourceCodeLocation?: null | SourceCodeLocation

parse5 source code location info.

Available if parsing with parse5 and location info is enabled.

startIndex

startIndex: null | number = null

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

abstractreadonlytype

type: ElementType

The type of the node.

Accessors

close

  • Node close tag details. Can be null for self closing tag


    Returns undefined | CharValue

  • Parameters

    Returns void

loc

  • Node position in document


    Returns Range

  • Parameters

    Returns void

nextSibling

open

parentNode

previousSibling

Methods

cloneNode

  • cloneNode<T>(this: T, recursive?: boolean): T
  • Clone this node, and optionally its children.


    Type parameters

    Parameters

    • this: T
    • recursive: boolean = false

      Clone child nodes as well.

    Returns T

    A clone of the node.