A MutationRecord
represents an individual DOM mutation. It is the object that is passed to {{domxref("MutationObserver")}}'s callback.
Properties
Property | Type | Description |
{{domxref("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. |
{{domxref("MutationRecord.target")}} | {{domxref("Node")}} |
Returns the node the mutation affected, depending on the {{domxref("MutationRecord.type")}}. For For For |
{{domxref("MutationRecord.addedNodes")}} | {{domxref("NodeList")}} |
Return the nodes added. Will be an empty {{domxref("NodeList")}} if no nodes were added. |
{{domxref("MutationRecord.removedNodes")}} | {{domxref("NodeList")}} |
Return the nodes removed. Will be an empty {{domxref("NodeList")}} if no nodes were removed. |
{{domxref("MutationRecord.previousSibling")}} | {{domxref("Node")}} |
Return the previous sibling of the added or removed nodes, or null . |
{{domxref("MutationRecord.nextSibling")}} | {{domxref("Node")}} |
Return the next sibling of the added or removed nodes, or null . |
{{domxref("MutationRecord.attributeName")}} | String |
Returns the local name of the changed attribute, or null . |
{{domxref("MutationRecord.attributeNamespace")}} | String |
Returns the namespace of the changed attribute, or null . |
{{domxref("MutationRecord.oldValue")}} | String |
The return value depends on the {{domxref("MutationRecord.type")}}. For For For |