Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Node Abstract

Re-exporting all of the node types.

Hierarchy

  • Node

Index

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
  • set nextSibling(next: null | ChildNode): void
  • Same as next. DOM spec-compatible alias.

    Returns null | ChildNode

  • Same as next. DOM spec-compatible alias.

    Parameters

    • next: null | ChildNode

    Returns void

  • Same as parent. DOM spec-compatible alias.

    Returns null | ParentNode

  • Same as parent. DOM spec-compatible alias.

    Parameters

    Returns void

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

    Returns null | ChildNode

  • Same as prev. DOM spec-compatible alias.

    Parameters

    • prev: null | ChildNode

    Returns void

Methods

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

    Type parameters

    Parameters

    • this: T
    • Optional recursive: boolean

      Clone child nodes as well.

    Returns T

    A clone of the node.