removeChild

fun <T : Node> removeChild(child: T): T(source)

The removeChild() method of the Node interface removes a child node from the DOM and returns the removed node.

MDN Reference