cloneNode

fun cloneNode(deep: Boolean = definedExternally): Node(source)

Returns a copy of node. If deep is true, the copy also includes the node's descendants.

MDN Reference