Firefox Tomorrow

web api instance property

MutationEvent: attrChange property

View on MDN ↗

The attrChange read-only property of the MutationEvent interface returns a number indicating what kind of change triggered the DOMAttrModified event. The three possible values are MODIFICATION (1), ADDITION (2) or REMOVAL (3). It has no meaning for other events and is then set to 0.

Value

An integer: 0, 1 (MODIFICATION), 2 (ADDITION), or 3 (REMOVAL).

Examples

element.addEventListener("DOMAttrModified", (event) => {
  console.log(event.attrChange);
});

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.