Interface MutationRecord

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

    MDN Reference

    interface MutationRecord {
        addedNodes: NodeList;
        attributeName: string;
        attributeNamespace: string;
        nextSibling: Node;
        oldValue: string;
        previousSibling: Node;
        removedNodes: NodeList;
        target: Node;
        type: MutationRecordType;
    }

    Properties

    addedNodes: NodeList

    Return the nodes added and removed respectively.

    MDN Reference

    attributeName: string

    Returns the local name of the changed attribute, and null otherwise.

    MDN Reference

    attributeNamespace: string

    Returns the namespace of the changed attribute, and null otherwise.

    MDN Reference

    nextSibling: Node

    Return the previous and next sibling respectively of the added or removed nodes, and null otherwise.

    MDN Reference

    oldValue: string

    The 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.

    MDN Reference

    previousSibling: Node

    Return the previous and next sibling respectively of the added or removed nodes, and null otherwise.

    MDN Reference

    removedNodes: NodeList

    Return the nodes added and removed respectively.

    MDN Reference

    target: Node

    Returns 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.

    MDN Reference

    Returns "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.

    MDN Reference