MutationObserver

external class MutationObserver(callback: MutationCallback)(source)

Provides the ability to watch for changes being made to the DOM tree. It is designed as a replacement for the older Mutation Events feature which was part of the DOM3 Events specification.

MDN Reference

Constructors

Link copied to clipboard
constructor(callback: MutationCallback)

Functions

Link copied to clipboard

Stops observer from observing any mutations. Until the observe() method is used again, observer's callback will not be invoked.

Link copied to clipboard
fun observe(target: Node, options: MutationObserverInit = definedExternally)

Instructs the user agent to observe a given target (a node) and report any mutations based on the criteria given by options (an object).

Link copied to clipboard

Empties the record queue and returns what was in there.