observe

fun observe(target: Node, options: MutationObserverInit = definedExternally)(source)

The MutationObserver method observe() configures the MutationObserver callback to begin receiving notifications of changes to the DOM that match the given options.

MDN Reference