EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.

MutationRecord object

Represents a single mutation that occurred on the element(s) being observed.

IE11

Syntax


function mutationObjectCallback(mutationRecordsList) {
  mutationRecordsList.forEach(function(mutationRecord) {
    console.log("Type of mutation: " + mutationRecord.type);
  });
}

DOM Information

Inheritance Hierarchy

The MutationRecord does not inherit from any class or interface.

Members

The MutationRecord object has these types of members:

Properties

The MutationRecord object has these properties.

PropertyAccess typeDescription

addedNodes

Read-only

Retrieves an array of nodes that were added. The array may be empty.

attributeName

Read-only

Retrieves the name of the attribute that was added, removed, or changed (or null otherwise).

attributeNamespace

Read-only

Retrieves the namespace of the attribute that was added, removed, or changed (or null otherwise).

nextSibling

Read-only

Retrieves the next sibling of the node that was added or removed, or null if none exists (or if MutationRecord.type is not childList)

oldValue

Read-only

Retrieves the previous value of the attribute or characterData that was mutated (or null otherwise)..

previousSibling

Read-only

Retrieves the previous sibling of the node that was added or removed, or null if none exists (or if MutationRecord.type is not childList)

removedNodes

Read-only

Retrieves an array of nodes that were removed. The array may be empty.

target

Read-only

Retrieves the node on which the MutationRecord was logged.

type

Retrieves the type of mutation represented by the MutationRecord.

 

Remarks

Each MutationObserver instance maintains an array of MutationRecords which is passed as the first parameter whenever the MutationObserver's callback function is invoked.

The MutationObserver's array of MutationRecords will accumulate all relevant changes until the MutationObserver.takeRecords method is called, which empties the queue and returns the records that were previously there.

See also

MutationObserver

 

 

표시:
© 2014 Microsoft