このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

MutationEvent: newValue プロパティ

Deprecated
To be removed

This feature is pending removal from browsers. Using it now may lead to broken functionality in future updates. Mutation events negatively impact performance and they were selected for removal from the web as part of Interop 2025.

Use the following features instead: MutationObserver.

newValueMutationEvent インターフェイスの読み取り専用プロパティで、文字列を返します。 DOMAttrModified イベントでは、 Attr ノードの新しい値を表します。 DOMCharacterDataModified イベントでは、CharacterData ノードの新しい値を表します。それ以外の場合は、空文字列 ("") を返します。

文字列です。

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

仕様書

この機能は、どの仕様書にも定義されていません。

ブラウザーの互換性