Fires on a node when a modification occurs in the subtree that belongs to it.
The DOMSubtreeModified event can be used instead of the other mutation events (DOMAttrModified, DOMCharacterDataModified, DOMNodeInserted, DOMNodeInsertedIntoDocument, DOMNodeRemoved and DOMNodeRemovedFromDocument).
How to register:
object.addEventListener ("DOMSubtreeModified", handler, useCapture);
This event cannot be registered in HTML.
The event object is accessible to all event handlers in all browsers. The properties of the event object contain additional information about the current event. To get further details about these properties and the possible event handler registration methods, please see the page for the event object.
Actions that invoke the DOMSubtreeModified event:
- Adding or removing a descendant node.
- Adding, removing or modifying an attribute of a descendant node.
- Changing the value of a descendant TextNode.
Example HTML code 1:
This example illustrates the use of the DOMSubtreeModified event. The DOMSubtreeModified event is not fired in Internet Explorer 9 when a node is inserted for the first time.
Did you find this example helpful?
User Contributed Comments