A MutationRecord represents an individual DOM mutation. It is the object that is passed to MutationObserver's callback.
Properties
| Property | Type | Description |
MutationRecord.type |
String |
Returns "attributes" if the mutation was an attribute mutation,"characterData" if it was a mutation to a CharacterData node,and "childList" if it was a mutation to the tree of nodes. |
MutationRecord.target |
Node |
Returns the node the mutation affected, depending on the MutationRecord.type.For attributes, it is the element whose attribute changed.For characterData, it is the CharacterData node.For childList, it is the node whose children changed. |
MutationRecord.addedNodes |
NodeList |
Return the nodes added. Will be an empty NodeList if no nodes were added. |
MutationRecord.removedNodes |
NodeList |
Return the nodes removed. Will be an empty NodeList if no nodes were removed. |
MutationRecord.previousSibling |
Node |
Return the previous sibling of the added or removed nodes, or null. |
MutationRecord.nextSibling |
Node |
Return the next sibling of the added or removed nodes, or null. |
MutationRecord.attributeName |
String |
Returns the local name of the changed attribute, or null. |
MutationRecord.attributeNamespace |
String |
Returns the namespace of the changed attribute, or null. |
MutationRecord.oldValue |
String |
The return value depends on the Note that for this to work as expected, |
Specifications
| Specification | Status | Comment |
|---|---|---|
| DOM The definition of 'MutationRecord' 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.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
MutationRecord | Chrome Full support Yes | Edge Full support ≤18 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
addedNodes | Chrome Full support Yes | Edge Full support 12 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
attributeName | Chrome Full support Yes | Edge Full support ≤18 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
attributeNamespace | Chrome Full support Yes | Edge Full support ≤18 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
nextSibling | Chrome Full support Yes | Edge Full support ≤18 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
oldValue | Chrome Full support Yes | Edge Full support ≤18 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
previousSibling | Chrome Full support Yes | Edge Full support 12 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
removedNodes | Chrome Full support Yes | Edge Full support 12 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
target | Chrome Full support Yes | Edge Full support 12 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
type | Chrome Full support Yes | Edge Full support 12 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
