UI Events
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
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
