MutationObserverInit.attributeOldValue

The MutationObserverInit dictionary's optional attributeOldValue property is used to specify whether or not to record the prior value of the altered attribute in MutationRecord objects denoting attribute value changes.

Syntax

var options = {
  attributeOldValue: true | false
}

Value

A Boolean value indicating whether or not the prior value of a changed attribute should be included in the MutationObserver.oldValue property when reporting attribute value changes. If true, oldValue is set accordingly. If false, it is not.

When using attributeOldValue, setting the attributes option to true is optional.

Example

See MutationObserverInit.attributes for example code that sets this property.

Specifications

Specification
DOM Standard (DOM)
# ref-for-dom-mutationobserverinit-attributeoldvalueā‘ 

Browser compatibility

BCD tables only load in the browser