web api interface
MutationRecord
The MutationRecord is a read-only interface that represents an individual DOM mutation observed by a MutationObserver. It is the object inside the array passed to the callback of a MutationObserver.
Instance properties
addedNodesRead only- : The nodes added by a mutation. Will be an empty
NodeListif no nodes were added.
- : The nodes added by a mutation. Will be an empty
attributeNameRead only- : The name of the changed attribute as a string, or
null.
- : The name of the changed attribute as a string, or
attributeNamespaceRead only- : The namespace of the changed attribute as a string, or
null.
- : The namespace of the changed attribute as a string, or
nextSiblingRead only- : The next sibling of the added or removed nodes, or
null.
- : The next sibling of the added or removed nodes, or
oldValueRead only- : The value depends on the
type:- For
attributes, it is the value of the changed attribute before the change. - For
characterData, it is the data of the changed node before the change. - For
childList, it isnull.
- For
- : The value depends on the
previousSiblingRead only- : The previous sibling of the added or removed nodes, or
null.
- : The previous sibling of the added or removed nodes, or
removedNodesRead only- : The nodes removed by a mutation. Will be an empty
NodeListif no nodes were removed.
- : The nodes removed by a mutation. Will be an empty
targetRead only- : The node the mutation affected, depending on the
MutationRecord.type.- For
attributes, it is the element whose attribute changed. - For
characterData, it is theCharacterDatanode. - For
childList, it is the node whose children changed.
- For
- : The node the mutation affected, depending on the
typeRead only- : A string representing the type of mutation:
attributesif the mutation was an attribute mutation,characterDataif it was a mutation to aCharacterDatanode, andchildListif it was a mutation to the tree of nodes.
- : A string representing the type of mutation:
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.