insertBefore

fun <T : Node> insertBefore(node: T, child: Node?): T(source)

The insertBefore() method of the Node interface inserts a node before a reference node as a child of a specified parent node.

MDN Reference