Inserts a node at the specified position relative to a another node.
For example, to insert a node as the last element of parent:
parent
import { insertElement } from "apprt-dom";const node = ...;const parent = document.body;insertElement(node, { referenceNode: parent, position: "last"}); Copy
import { insertElement } from "apprt-dom";const node = ...;const parent = document.body;insertElement(node, { referenceNode: parent, position: "last"});
a html node
the position options
Inserts a node at the specified position relative to a another node.
For example, to insert a node as the last element of
parent
: