Back to Content

MutationEvent: newValue property

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

latest633 B
Original Source

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

The newValue read-only property of the {{domxref("MutationEvent")}} interface returns a string. In DOMAttrModified events, it represents the new value of the {{domxref("Attr")}} node. In DOMCharacterDataModified events, it contains the new value of the {{domxref("CharacterData")}} node. In all other cases, returns the empty string ("").

Value

A string.

Examples

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}