MDN self-hosted library · e01.org

MutationEvent: newValue property

UI Events

Open notebook · 1 cells web-api-instance-property upstream source

UI Events

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

Value

A string.

Examples

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

Specifications

Browser compatibility