A MutationRecord
represents an individual DOM mutation. It is the object that is passed to MutationObserver
's callback.
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 |
| Returns the node the mutation affected, depending on the For For For |
MutationRecord.addedNodes |
| Return the nodes added. Will be an empty NodeList if no nodes were added. |
MutationRecord.removedNodes |
| Return the nodes removed. Will be an empty NodeList if no nodes were removed. |
MutationRecord.previousSibling |
| Return the previous sibling of the added or removed nodes, or null . |
MutationRecord.nextSibling |
| 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 For For For Note that for this to work as expected, |
Specification | Status | Comment |
---|---|---|
DOM The definition of 'MutationRecord' in that specification. | Living Standard |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | ? | ? | ? | ? | ? | ? |
type |
? | ? | ? | ? | ? | ? |
target |
? | ? | ? | ? | ? | ? |
addedNodes |
? | ? | ? | ? | ? | ? |
removedNodes |
? | ? | ? | ? | ? | ? |
previousSibling |
? | ? | ? | ? | ? | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | ? | ? | ? | ? | ? | ? | ? |
type |
? | ? | ? | ? | ? | ? | ? |
target |
? | ? | ? | ? | ? | ? | ? |
addedNodes |
? | ? | ? | ? | ? | ? | ? |
removedNodes |
? | ? | ? | ? | ? | ? | ? |
previousSibling |
? | ? | ? | ? | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord