The MutationObserverInit
dictionary describes the configuration of a mutation observer. As such, it's primarily used as the type of the options
parameter on the MutationObserver.observe()
method.
Properties
At a minimum, one of childList
, attributes
, and/or characterData
must be true
when you call observe()
. Otherwise, a TypeError
exception will be thrown.
subtree
Optional- Set to
true
to extend monitoring to the entire subtree of nodes rooted attarget
. All of the otherMutationObserverInit
properties are then extended to all of the nodes in the subtree instead of applying solely to thetarget
node. The default value isfalse
. childList
Optional- Set to
true
to monitor the target node (and, ifsubtree
istrue
, its descendants) for the addition of new child nodes or removal of existing child nodes. The default value isfalse
. attributes
Optional- Set to
true
to watch for changes to the value of attributes on the node or nodes being monitored. The default value istrue
if either ofattributeFilter
orattributeOldValue
is specified, otherwise the default value isfalse
. attributeFilter
Optional- An array of specific attribute names to be monitored. If this property isn't included, changes to all attributes cause mutation notifications.
attributeOldValue
Optional- Set to
true
to record the previous value of any attribute that changes when monitoring the node or nodes for attribute changes; see Monitoring attribute values in MutationObserver for details on watching for attribute changes and value recording. The default value isfalse
. characterData
Optional- Set to
true
to monitor the specified target node (and, ifsubtree
istrue
, its descendants) for changes to the character data contained within the node or nodes. The default value istrue
ifcharacterDataOldValue
is specified, otherwise the default value isfalse
. characterDataOldValue
Optional- Set to
true
to record the previous value of a node's text whenever the text changes on nodes being monitored. For details and an example, see Monitoring text content changes in MutationObserver. The default value isfalse
.
Specifications
Specification | Status | Comment |
---|---|---|
DOMThe definition of 'MutationObserverInit' in that specification. | Living Standard |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
MutationObserverInit
|
Chrome Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Edge
Full support 12 |
Firefox
Full support 14 |
IE
Full support 11 |
Opera
Full support 15 |
Safari Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
WebView Android
? |
Chrome Android Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Firefox Android
Full support 14 |
Opera Android
Full support 14 |
Safari iOS Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
Samsung Internet Android Full support 1.5 Full support 1.5 No support 1.0 — 1.5 Prefixed' Implemented with the vendor prefix: webkit |
attributeFilter
|
Chrome Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Edge Full support 12 Full support 12 Notes' Before Edge 79, this requires |
Firefox
Full support 14 |
IE Full support 11 Full support 11 Notes' Internet Explorer requires |
Opera
Full support 15 |
Safari Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
WebView Android
? |
Chrome Android Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Firefox Android
Full support 14 |
Opera Android
Full support 14 |
Safari iOS Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
Samsung Internet Android Full support 1.5 Full support 1.5 No support 1.0 — 1.5 Prefixed' Implemented with the vendor prefix: webkit |
attributeOldValue
|
Chrome Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Edge
Full support 12 |
Firefox Full support 14 Full support 14 Notes' Starting in Firefox 36, |
IE
Full support 11 |
Opera
Full support 15 |
Safari Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
WebView Android
? |
Chrome Android Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Firefox Android Full support 14 Full support 14 Notes' Starting in Firefox 36, |
Opera Android
Full support 14 |
Safari iOS Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
Samsung Internet Android Full support 1.5 Full support 1.5 No support 1.0 — 1.5 Prefixed' Implemented with the vendor prefix: webkit |
attributes
|
Chrome Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Edge
Full support 12 |
Firefox Full support 14 Full support 14 Notes' Starting in Firefox 36, |
IE
Full support 11 |
Opera
Full support 15 |
Safari Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
WebView Android
? |
Chrome Android Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Firefox Android Full support 14 Full support 14 Notes' Starting in Firefox 36, |
Opera Android
Full support 14 |
Safari iOS Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
Samsung Internet Android Full support 1.5 Full support 1.5 No support 1.0 — 1.5 Prefixed' Implemented with the vendor prefix: webkit |
characterData
|
Chrome Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Edge
Full support 12 |
Firefox Full support 14 Full support 14 Notes' Starting in Firefox 36, |
IE
Full support 11 |
Opera
Full support 15 |
Safari Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
WebView Android
? |
Chrome Android Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Firefox Android Full support 14 Full support 14 Notes' Starting in Firefox 36, |
Opera Android
Full support 14 |
Safari iOS Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
Samsung Internet Android Full support 1.5 Full support 1.5 No support 1.0 — 1.5 Prefixed' Implemented with the vendor prefix: webkit |
characterDataOldValue
|
Chrome Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Edge
Full support 12 |
Firefox Full support 14 Full support 14 Notes' Starting in Firefox 36, |
IE
Full support 11 |
Opera
Full support 15 |
Safari Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
WebView Android
? |
Chrome Android Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Firefox Android Full support 14 Full support 14 Notes' Starting in Firefox 36, |
Opera Android
Full support 14 |
Safari iOS Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
Samsung Internet Android Full support 1.5 Full support 1.5 No support 1.0 — 1.5 Prefixed' Implemented with the vendor prefix: webkit |
childList
|
Chrome Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Edge
Full support 12 |
Firefox
Full support 14 |
IE
Full support 11 |
Opera
Full support 15 |
Safari Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
WebView Android
? |
Chrome Android Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Firefox Android
Full support 14 |
Opera Android
Full support 14 |
Safari iOS Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
Samsung Internet Android Full support 1.5 Full support 1.5 No support 1.0 — 1.5 Prefixed' Implemented with the vendor prefix: webkit |
subtree
|
Chrome Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Edge
Full support 12 |
Firefox
Full support 14 |
IE
Full support 11 |
Opera
Full support 15 |
Safari Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
WebView Android
? |
Chrome Android Full support 26 Full support 26 No support 18 — 26 Prefixed' Implemented with the vendor prefix: webkit |
Firefox Android
Full support 14 |
Opera Android
Full support 14 |
Safari iOS Full support 7 Full support 7 No support 6 — 7 Prefixed' Implemented with the vendor prefix: webkit |
Samsung Internet Android Full support 1.5 Full support 1.5 No support 1.0 — 1.5 Prefixed' Implemented with the vendor prefix: webkit |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
- See implementation notes.'
- See implementation notes.
- Requires a vendor prefix or different name for use.'
- Requires a vendor prefix or different name for use.
MutationObserverInit by Mozilla Contributors is licensed under CC-BY-SA 2.5.