docs.rodeo

MDN Web Docs mirror

MutationEvent

{{APIRef("UI Events")}} {{Deprecated_Header}} {{non-standard_header}} 

The MutationEvent interface provides event properties that are specific to modifications to the Document Object Model (DOM) hierarchy and nodes.

[!NOTE] Using mutation events is problematic:

They have been deprecated in favor of mutation observers. Consider using these instead.

{{InheritanceDiagram}} 

Instance properties

This interface also inherits properties from its parent {{domxref("UIEvent")}} , and indirectly from {{domxref("Event")}} .

Instance methods

Mutation events list

The following is a list of all mutation events:

Examples

You can register a listener for mutation events using {{DOMxRef("EventTarget.addEventListener()")}}  as follows:

element.addEventListener(
  "DOMNodeInserted",
  (event) => {
    // …
  },
  false,
);

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN