initMutationEvent method
Initializes a new Document Object Model (DOM) mutation (modification) event that the createEvent method created.
createEvent()/initEvent() constructor pattern for synthetic events is deprecated. See the Synthetic Events page for more information.![]() ![]() |
Syntax
var retval = MutationEvent.initMutationEvent(eventType, canBubble, cancelable, relatedNodeArg, prevValueArg, newValueArg, attrNameArg, attrChangeArg);Parameters
- eventType [in]
-
Type: String
One of the following values, or a user-defined custom event type.
-
A general modification event. This event occurs for all changes to the document.
-
A node was inserted as a child of another node.
-
A node was removed from its parent node.
-
An attribute node has been changed. The value of the attrChange property indicates whether the node was added, modified, or removed.
-
Character data within the node was modified. The target of the event is the text node.
- canBubble [in]
-
Type: Boolean
- cancelable [in]
-
Type: Boolean
- relatedNodeArg [in]
-
Type: Object
A secondary node that is related to the event. This value is returned as the relatedNode property of the event.
- prevValueArg [in]
-
Type: String
The previous value of the attribute or text node. This value is returned as the prevValue property of the event.
- newValueArg [in]
-
Type: String
The new value of the attribute or text node. This value is returned as the newValue property of the event.
- attrNameArg [in]
-
Type: String
The name of the changed attribute in a DOMAttrModified event. This value is returned as the attrName property of the event.
- attrChangeArg [in]
-
Type: Number
The type of modification in a DOMAttrModified event. This value is returned as the attrChange property of the event.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
- Document Object Model (DOM) Level 3 Events Specification, Section 5.2.8
Remarks
The DOMNodeInsertedIntoDocument and DOMNodeRemovedFromDocument event type values are not supported.
See also

