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

View in English Always switch to English

MutationEvent: attrName プロパティ

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.

attrNameMutationEvent インターフェイスの読み取り専用プロパティで、 DOMAttrModified イベントの影響を受けるノードの名前を文字列で返します。これは他のイベントでは意味を持たず、空文字列 ("") に設定されます。

文字列です。

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

仕様書

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

ブラウザーの互換性