Function importNode

  • Imports DOM node from one document to another.

    Type Parameters

    • TNode extends Node<TNode>

      DOM node type.

    Parameters

    • from: TNode

      The node to import.

    • to: Node

      The node to append imported node to.

    • Optional importContent: ((this, from, to) => void)

      A function that imports nodes nested in parent element. importNodeContent by default.

        • (this, from, to): void
        • Parameters

          • this: void
          • from: TNode
          • to: TNode

          Returns void

    Returns TNode

    Imported node.

  • Imports DOM node from one document to another and inserts it before the given node.

    Type Parameters

    • TNode extends Node<TNode>

      DOM node type.

    Parameters

    • from: TNode

      The node to import.

    • to: Node

      The node to append imported node to.

    • Optional before: null | Node

      The node to insert imported node before, or null to append it to the end of target one.

    • Optional importContent: ((this, from, to) => void)

      A function that imports nodes nested in parent element. importNodeContent by default.

        • (this, from, to): void
        • Parameters

          • this: void
          • from: TNode
          • to: TNode

          Returns void

    Returns TNode

    Imported node.

Generated using TypeDoc