MutationEvent: attrChange プロパティ

非推奨;: この機能は非推奨になりました。まだ対応しているブラウザーがあるかもしれませんが、すでに関連するウェブ標準から削除されているか、削除の手続き中であるか、互換性のためだけに残されている可能性があります。使用を避け、できれば既存のコードは更新してください。このページの下部にある互換性一覧表を見て判断してください。この機能は突然動作しなくなる可能性があることに注意してください。

attrChangeMutationEvent インターフェイスの読み取り専用プロパティで、 DOMAttrModified イベントのトリガーとなった変更の種類を示す数値を返します。取り得る値は MODIFICATION (1)、ADDITION (2)、REMOVAL(3) の 3 つです。この値は他のイベントでは意味を持たず、0 に設定されます。

整数です。 01 (MODIFICATION)、2 (ADDITION)、3 (REMOVAL) のいずれかです。

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

仕様書

No specification found

No specification data found for api.MutationEvent.attrChange.
Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
attrChange
DeprecatedNon-standard

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Non-standard. Check cross-browser support before using.
Deprecated. Not for use in new websites.