MutationRecord class

MutationRecord class

A MutationRecord represents an individual DOM mutation. It is the object that is passed to MutationObserver’s MutationCallback.

Inheritance: MutationRecordDOMObject

The MutationRecord type exposes the following members:

Properties

PropertyDescription
typeReturns “attributes” if it 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.
targetReturns the node the mutation affected, depending on the 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.
added_nodesReturn the nodes added.
removed_nodesReturn the nodes removed.
previous_siblingReturns the previous sibling of the added or removed nodes, or null.
next_siblingReturn the next sibling of the added or removed nodes, or null.
attribute_nameReturns the local name of the changed attribute, and null otherwise.
attribute_namespaceReturns the namespace of the changed attribute, and null otherwise.
old_valueThe return value depends on 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 is null.

Methods

MethodDescription
get_platform_typeThis method is used to retrieve ECMAScript object Type.

See Also