MutationEvent |
details about a document change |
Availability
DOM Level 2 Events
Inherits from/Overrides
Event MutationEvent
Constants
The following constants represent the set of possible values for the
attrChange property:
- unsigned short MODIFICATION = 1
-
An Attr node was modified.
- unsigned short ADDITION = 2
-
An Attr node was added.
- unsigned short REMOVAL = 3
-
An Attr node was removed.
Properties
- readonly unsigned short attrChange
-
How the
attribute was changed, for DOMAttrModified events. The three possible
values are defined in the "Constants" section.
- readonly String attrName
-
The name
of the attribute that was changed for DOMAttrModified events.
- readonly String newValue
-
The new
value of the Attr node for DOMAttrModified events, or the new text
value of a Text, Comment, CDATASection, or ProcessingInstruction node
for DOMCharacterDataModified events.
- readonly String prevValue
-
The
previous value of an Attr node for DOMAttrModified events, or the
previous value of a Text, Comment, CDATASection, or
ProcessingInstruction node for DOMCharacterDataModified events.
- readonly Node relatedNode
-
The
relevant Attr node for DOMAttrModified events, or the parent of the
node that was inserted or removed for DOMNodeInserted and
DOMNodeRemoved events.
Methods
- initMutationEvent( )
-
Initializes the properties of a newly created MutationEvent object.
Description
This interface defines the type of Event object that is passed to
events of types listed here (note that none of these event types are
cancelable with Event.preventDefault( )):
- DOMAttrModified
-
Generated when an attribute of a document element is added, removed,
or changed. The target of the event is the element that contains the
attribute, and the event bubbles up from there.
- DOMCharacterDataModified
-
Generated when the character data of a Text, Comment, CDATASection,
or ProcessingInstruction node changes. The event target is the node
that changed, and the event bubbles up from there.
- DOMNodeInserted
-
Generated after a node is added as a child of another node. The
target of the event is the node that was inserted, and the event
bubbles up the tree from there. The relatedNode
property specifies the new parent of the inserted node. This event is
not generated for any descendants of the inserted node.
- DOMNodeInsertedIntoDocument
-
Generated after a node is inserted into the document tree, as well as
for nodes that are inserted directly into the tree and nodes that are
indirectly inserted when an ancestor is inserted. The target of this
event is the node that is inserted. Because events of this type may
be targeted at every node in a subtree, they do not bubble.
- DOMNodeRemoved
-
Generated immediately before a node is removed from its parent. The
target of the event is the node being removed, and the event bubbles
up the document tree from there. The relatedNode
property holds the parent node from which the node is being removed.
- DOMNodeRemovedFromDocument
-
Generated immediately before a node is removed from the document
tree. Separate events are generated for the node that is directly
removed and for each of its descendant nodes. The target of the event
is the node that is about to be removed. Events of this type do not
bubble.
- DOMSubtreeModified
-
Generated as a kind of summary event when a call to a DOM method
causes multiple mutation events to be fired. The target of this event
is the most deeply nested common ancestor of all changes that
occurred in the document, and it bubbles up the document tree from
that point. If you are not interested in the details of the changes
but merely want to be notified which portions of the document have
changed, you may prefer to register listeners for this type of event.
|