MutationEvent: initMutationEvent() メソッド
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.>
initMutationEvent() は MutationEvent インターフェイスのメソッドで、一度作成された変異イベントの値を初期化します(通常は Document.createEvent() メソッドを使用します)。
このメソッドは、 EventTarget.dispatchEvent() を使用して、配信される前にイベントを設定するために呼び出される必要があります。
メモ: 一般に、これらのイベントを自分で作成することはなく、ブラウザーが作成します。
構文
initMutationEvent(type, canBubble, cancelable, relatedNode,
prevValue, newValue, attrName, attrChange)
引数
type-
イベントの
typeに設定する文字列。ブラウザーはMutationEventに次の値を設定します。DOMAttrModified,DOMAttributeNameChanged,DOMCharacterDataModified,DOMElementNameChanged,DOMNodeInserted,DOMNodeInsertedIntoDocument,DOMNodeRemoved,DOMNodeRemovedFromDocument,DOMSubtreeModified canBubble-
論理値で、イベントがバブリングするかどうかを示します。
Event.bubblesの値を設定します。 cancelable-
論理値で、イベントの既定のアクションを阻止できるかどうかを示します。
Event.cancelableの値を設定します。 -
文字列で、変更するノードの新しい値を表します。
MutationEvent.relatedNodeの値を設定します。 prevValue-
文字列で、変更するノードの前回値を表します。
MutationEvent.prevValueの値を設定します。 newValue-
文字列で、変更するノードの新しい値を表します。
MutationEvent.newValueの値を設定します。 attrName-
文字列で、もしあれば、変更された
Attrノードの名前を表します。MutationEvent.attrNameの値を設定します。 attrChange-
整数で、属性ノードが変更された理由を表します。
MutationEvent.attrChangeの値を設定します。
返値
なし (undefined)。