Back to Content

MutationEvent: attrName property

files/en-us/web/api/mutationevent/attrname/index.md

latest529 B
Original Source

{{APIRef("UI Events")}}{{Deprecated_Header}}{{non-standard_header}}

The attrName read-only property of the {{domxref("MutationEvent")}} interface returns a string with the name of the node affected by the DOMAttrModified event. It has no meaning for other events and is then set to the empty string ("").

Value

A string.

Examples

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}