Class NodeAbstract

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

Hierarchy

  • Node

Constructors

Properties

endIndex: null | number

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

next: null | ChildNode

Next sibling

nodeType: number

DOM spec-compatible node type.

parent: null | ParentNode

Parent of the node

prev: null | ChildNode

Previous sibling

sourceCodeLocation?: null | SourceCodeLocation

parse5 source code location info.

Available if parsing with parse5 and location info is enabled.

startIndex: null | number

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

type: ElementType

The type of the node.

Accessors

  • get nextSibling(): null | ChildNode
  • Same as next. DOM spec-compatible alias.

    Returns null | ChildNode

  • set nextSibling(next: null | ChildNode): void
  • Parameters

    • next: null | ChildNode

    Returns void

  • get parentNode(): null | ParentNode
  • Same as parent. DOM spec-compatible alias.

    Returns null | ParentNode

  • set parentNode(parent: null | ParentNode): void
  • Parameters

    Returns void

  • get previousSibling(): null | ChildNode
  • Same as prev. DOM spec-compatible alias.

    Returns null | ChildNode

  • set previousSibling(prev: null | ChildNode): void
  • Parameters

    • prev: null | ChildNode

    Returns void

Methods

  • Clone this node, and optionally its children.

    Returns

    A clone of the node.

    Type Parameters

    Parameters

    • this: T
    • Optional recursive: boolean

      Clone child nodes as well.

    Returns T