domhandler
    Preparing search index...

    Class Element

    An element within the DOM.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    attribs: { [name: string]: string }
    children: ChildNode[]
    endIndex: number | null = null

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

    name: string
    namespace?: string

    Element namespace (parse5 only).

    next: ChildNode | null = null

    Next sibling

    parent: ParentNode | null = null

    Parent of the node

    prev: ChildNode | null = null

    Previous sibling

    sourceCodeLocation?: TagSourceCodeLocation | null

    parse5 source code location info, with start & end tags.

    Available if parsing with parse5 and location info is enabled.

    startIndex: number | null = null

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

    type: Script | Style | Tag

    The type of the node.

    "x-attribsNamespace"?: Record<string, string>

    Element attribute namespaces (parse5 only).

    "x-attribsPrefix"?: Record<string, string>

    Element attribute namespace-related prefixes (parse5 only).

    Accessors

    Methods

    • 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.