Package | dom.events |
Class | public class MutationEvent |
Inheritance | MutationEvent Event Object |
Subclasses | MutationNameEvent |
Introduced in: | DOM 2 Events |
Modified in: | DOM 3 Events |
To create an instance of the MutationEvent interface, use the DocumentEvent.createEvent("MutationEvent") method call.
See also
Property | Defined By | ||
---|---|---|---|
DOM 2 Events attrChange : Number [read-only]
Indicates the type of change which triggered the DOMAttrModified event. | MutationEvent | ||
DOM 2 Events attrName : DOMString [read-only]
Indicates the name of the changed Attr node in a DOMAttrModified event. | MutationEvent | ||
DOM 2 Events bubbles : Boolean [read-only]
Used to indicate whether or not an event is a bubbling event. | Event | ||
DOM 2 Events cancelable : Boolean [read-only]
Indicates whether the event is cancelable or not. | Event | ||
DOM 2 Events currentTarget : EventTarget [read-only]
Identifies the current target for the event, as the event traverses the DOM. | Event | ||
DOM 3 Events defaulPrevented : Boolean [read-only]
Used to indicate whether Event.preventDefault() has been called for
this event. | Event | ||
DOM 2 Events eventPhase : Number [read-only]
Used to indicate which phase of event flow is currently being accomplished. | Event | ||
Non-Standard explicitOriginalTarget : nsIDOMEventTarget [read-only]
The explicit original target of the event. | Event | ||
Non-Standard isTrusted : Boolean [read-only]
Determines if the event was from the user or script generated. | Event | ||
DOM 3 Events namespaceURI : DOMString [read-only]
The namespace URI associated with this event at initialization time, or
null if it is unspecified. | Event | ||
DOM 2 Events newValue : DOMString [read-only]
Indicates the new value of the Attr node in DOMAttrModified events, and
of the CharacterData node in DOMCharacterDataModified events. | MutationEvent | ||
Non-Standard originalTarget : * [read-only]
The original target of the event before any retargetings. | Event | ||
DOM 2 Events prevValue : DOMString [read-only]
Indicates the previous value of the Attr node in DOMAttrModified events,
and of the CharacterData node in DOMCharacterDataModified events. | MutationEvent | ||
DOM 2 Events relatedNode : Node [read-only]
is used to identify a secondary node related to a mutation event. | MutationEvent | ||
DOM 2 Events target : EventTarget [read-only]
Used to indicate the event target. | Event | ||
DOM 2 Events timeStamp : DOMTimeStamp [read-only]
Used to specify the time at which the event was created in milliseconds
relative to 1970-01-01T00:00:00Z. | Event | ||
DOM 2 Events type : DOMString [read-only]
The local name of the event type. | Event |
Method | Defined By | ||
---|---|---|---|
Initializes attributes of an Event created through the
DocumentEvent.createEvent method. | Event | ||
DOM 3 Events initEventNS(namespaceURIArg:DOMString, typeArg:DOMString, canBubbleArg:Boolean, cancelableArg:Boolean):void
Initializes attributes of an Event object. | Event | ||
DOM 2 Events initMutationEvent(typeArg:DOMString, canBubbleArg:Boolean, cancelableArg:Boolean, relatedNodeArg:XMLNode, prevValueArg:DOMString, newValueArg:DOMString, attrNameArg:DOMString, attrChangeArg:Number):void
Initializes attributes of a MutationEvent object. | MutationEvent | ||
DOM 3 Events initMutationEventNS(namespaceURIArg:DOMString, typeArg:DOMString, canBubbleArg:Boolean, cancelableArg:Boolean, relatedNodeArg:XMLNode, prevValueArg:DOMString, newValueArg:DOMString, attrNameArg:DOMString, attrChangeArg:Number):void
Initializes attributes of a MutationEvent object. | MutationEvent | ||
Obsolete preventBubble():void
Prevents the event from bubbling. | Event | ||
Obsolete preventCapture():void
This method is deprecated in favor of standard stopPropagation and is removed in Gecko 1.9. | Event | ||
DOM 2 Events preventDefault():void
Cancels the event if it is cancelable, without stopping further propagation of the event. | Event | ||
DOM 3 Events stopImmediatePropogation():void
Prevents other event listeners from being triggered and, unlike
Event.stopPropagation() its effect is immediate . | Event | ||
DOM 2 Events stopPropogation():void
Prevents other event listeners from being triggered but its effect is
deferred until all event listeners attached on the Event.currentTarget
have been triggered . | Event |
Constant | Defined By | ||
---|---|---|---|
HTML 4.0 abort : String = abort [static]
Loading of a resource has been aborted. | Event | ||
DOM 2 Events ADDITION : Number = 2 [static]
The Attr was just added. | MutationEvent | ||
DOM 2 Events AT_TARGET : Number = 2 [static]
The current event is in the target phase, i.e. | Event | ||
DOM 2 Events BUBBLING_PHASE : Number = 3 [static]
The current event phase is the bubbling phase. | Event | ||
DOM 2 Events CAPTURING_PHASE : Number = 1 [static]
The current event phase is the capture phase. | Event | ||
HTML 4.0 change : String = change [static]
A control loses the input focus and its value has been modified since gaining focus. | Event | ||
DOM 2 Events DOMAttrModified : String = DOMAttrModified [static]
Occurs after Attr.value has been modified and after an Attr node has been added to or removed from an Element. | MutationEvent | ||
DOM 2 Events DOMCharacterDataModified : String = DOMCharacterDataModified [static]
Occurs after CharacterData.data or ProcessingInstruction.data have been modified but the node itself has not been
inserted or deleted. | MutationEvent | ||
DOM 2 Events DOMNodeInserted : String = DOMNodeInserted [static]
A node has been added as a child of another node or, in case of Attr nodes, has been added to an Element. | MutationEvent | ||
DOM 2 Events DOMNodeInsertedIntoDocument : String = DOMNodeInsertedIntoDocument [static]
A node has been inserted into a document, either through direct insertion of the node or insertion of a subtree in which
it is contained; Attr nodes are considered part of an Element's subtree. | MutationEvent | ||
DOM 2 Events DOMNodeRemoved : String = DOMNodeRemoved [static]
A node is being removed from its parent node or, in case of Attr nodes, removed from its ownerElement. | MutationEvent | ||
DOM 2 Events DOMNodeRemovedFromDocument : String = DOMNodeRemovedFromDocument [static]
A node is being removed from a document, either through direct removal of the node or removal of a subtree in which
it is contained; Attr nodes are considered part of an Element's subtree. | MutationEvent | ||
DOM 2 Events DOMSubtreeModified : String = DOMSubtreeModified [static]
This is a general event for notification of all changes to the document. | MutationEvent | ||
HTML 4.0 error : String = error [static]
A resource failed to load, or has been loaded but cannot be interpreted according to its semantics
such as an invalid image, a script execution error, or non-well-formed XML. | Event | ||
HTML 4.0 load : String = load [static]
The DOM Implementation finishes loading the resource (such as the document) and any dependent resources
(such as images, style sheets, or scripts). | Event | ||
DOM 2 Events MODIFICATION : Number = 1 [static]
The Attr was modified in place. | MutationEvent | ||
DOM 2 Events REMOVAL : Number = 3 [static]
The Attr was just removed. | MutationEvent | ||
HTML 4.0 reset : String = reset [static]
A form, such as a [HTML 4.01] or [XHTML 1.0] form, is reset. | Event | ||
HTML 4.0 select : String = select [static]
A user selects some text. | Event | ||
HTML 4.0 submit : String = submit [static]
A form, such as a [HTML 4.01] or [XHTML 1.0] form, is submitted. | Event | ||
HTML 4.0 unload : String = unload [static]
The DOM implementation removes from the environment the resource (such as the document) or any dependent
resources (such as images, style sheets, scripts). | Event |
DOM 2 Events attrChange | property |
attrChange:Number
[read-only] Introduced in: | DOM 2 Events |
Indicates the type of change which triggered the DOMAttrModified event. The values can be MODIFICATION, ADDITION, or REMOVAL.
public function get attrChange():Number
See also
DOM 2 Events attrName | property |
attrName:DOMString
[read-only] Introduced in: | DOM 2 Events |
Indicates the name of the changed Attr node in a DOMAttrModified event.
public function get attrName():DOMString
See also
DOM 2 Events newValue | property |
newValue:DOMString
[read-only] Introduced in: | DOM 2 Events |
Indicates the new value of the Attr node in DOMAttrModified events, and of the CharacterData node in DOMCharacterDataModified events.
public function get newValue():DOMString
See also
DOM 2 Events prevValue | property |
prevValue:DOMString
[read-only] Introduced in: | DOM 2 Events |
Indicates the previous value of the Attr node in DOMAttrModified events, and of the CharacterData node in DOMCharacterDataModified events.
public function get prevValue():DOMString
See also
DOM 2 Events relatedNode | property |
relatedNode:Node
[read-only] Introduced in: | DOM 2 Events |
is used to identify a secondary node related to a mutation event. For example, if a mutation event is dispatched to a node indicating that its parent has changed, the relatedNode is the changed parent. If an event is instead dispatched to a subtree indicating a node was changed within it, the relatedNode is the changed node. In the case of the DOMAttrModified event it indicates the Attr node which was modified, added, or removed.
public function get relatedNode():Node
See also
DOM 2 Events initMutationEvent | () | method |
public function initMutationEvent(typeArg:DOMString, canBubbleArg:Boolean, cancelableArg:Boolean, relatedNodeArg:XMLNode, prevValueArg:DOMString, newValueArg:DOMString, attrNameArg:DOMString, attrChangeArg:Number):void
Introduced in: | DOM 2 Events |
Initializes attributes of a MutationEvent object. This method has the same behavior as Event.initEvent().
Parameters
typeArg:DOMString — Specifies Event.type, the local name of the event type.
| |
canBubbleArg:Boolean — Specifies Event.bubbles. This parameter overrides the intrinsic bubbling behavior of the event.
| |
cancelableArg:Boolean — Specifies Event.cancelable. This parameter overrides the intrinsic cancelable behavior of the event.
| |
relatedNodeArg:XMLNode — Specifies MutationEvent.relatedNode.
| |
prevValueArg:DOMString — Specifies MutationEvent.prevValue. This value may be null.
| |
newValueArg:DOMString — Specifies MutationEvent.newValue. This value may be null.
| |
attrNameArg:DOMString — Specifies MutationEvent.attrName. This value may be null.
| |
attrChangeArg:Number — Specifies MutationEvent.attrChange. This value may be null.
|
See also
DOM 3 Events initMutationEventNS | () | method |
public function initMutationEventNS(namespaceURIArg:DOMString, typeArg:DOMString, canBubbleArg:Boolean, cancelableArg:Boolean, relatedNodeArg:XMLNode, prevValueArg:DOMString, newValueArg:DOMString, attrNameArg:DOMString, attrChangeArg:Number):void
Introduced in: | DOM 3 Events |
Initializes attributes of a MutationEvent object. This method has the same behavior as Event.initEventNS().
Parameters
namespaceURIArg:DOMString — Specifies Event.namespaceURI, the namespace URI associated with this event, or null if no namespace.
| |
typeArg:DOMString — Specifies Event.type, the local name of the event type.
| |
canBubbleArg:Boolean — Specifies Event.bubbles. This parameter overrides the intrinsic bubbling behavior of the event.
| |
cancelableArg:Boolean — Specifies Event.cancelable. This parameter overrides the intrinsic cancelable behavior of the event.
| |
relatedNodeArg:XMLNode — Specifies MutationEvent.relatedNode.
| |
prevValueArg:DOMString — Specifies MutationEvent.prevValue. This value may be null.
| |
newValueArg:DOMString — Specifies MutationEvent.newValue. This value may be null.
| |
attrNameArg:DOMString — Specifies MutationEvent.attrName. This value may be null.
| |
attrChangeArg:Number — Specifies MutationEvent.attrChange. This value may be null.
|
See also
DOM 2 Events ADDITION | Constant |
public static const ADDITION:Number = 2
Introduced in: | DOM 2 Events |
The Attr was just added.
See also
DOM 2 Events DOMAttrModified | Constant |
public static const DOMAttrModified:String = DOMAttrModified
Introduced in: | DOM 2 Events |
Occurs after Attr.value has been modified and after an Attr node has been added to or removed from an Element. The target node of this event is the Element node where the change occured. It is implementation dependent whether this event type occurs when the children of the Attr node are changed in ways that do not affect the value of Attr.value.
Title | Value |
---|---|
Cancelable | No |
Bubbles | Yes |
Target | Element |
Context info | MutationEvent.attrName and MutationEvent.attrChange are in use. The value of MutationEvent.relatedNode indicates the Attr node that has been modified, added, or removed. If the Attr node has been added, MutationEvent.newValue is in use. If the Attr node has been removed, MutationEvent.prevValue is in use. If the Attr node has been modified, MutationEvent.newValue and MutationEvent.prevValue are in use. |
See also
DOM 2 Events DOMCharacterDataModified | Constant |
public static const DOMCharacterDataModified:String = DOMCharacterDataModified
Introduced in: | DOM 2 Events |
Occurs after CharacterData.data or ProcessingInstruction.data have been modified but the node itself has not been inserted or deleted. The target node of this event is the CharacterData node or the ProcessingInstruction node.
Title | Value |
---|---|
Cancelable | No |
Bubbles | Yes |
Target | Text, Comment, CDATASection, ProcessingInstruction |
Context info | MutationEvent.prevValue, and MutationEvent.newValue are in use. |
See also
DOM 2 Events DOMNodeInserted | Constant |
public static const DOMNodeInserted:String = DOMNodeInserted
Introduced in: | DOM 2 Events |
A node has been added as a child of another node or, in case of Attr nodes, has been added to an Element. This event is dispatched after the insertion has taken place. The target node of this event is the node being inserted.
Title | Value |
---|---|
Cancelable | No |
Bubbles | Yes |
Target | Element, Attr, Text, Comment, CDATASection, DocumentType, EntityReference, ProcessingInstruction |
Context info | MutationEvent.relatedNode holds the parent node of the node that has been inserted or, in case of Attr nodes, the ownerElement of the Attr node. |
See also
DOM 2 Events DOMNodeInsertedIntoDocument | Constant |
public static const DOMNodeInsertedIntoDocument:String = DOMNodeInsertedIntoDocument
Introduced in: | DOM 2 Events |
A node has been inserted into a document, either through direct insertion of the node or insertion of a subtree in which it is contained; Attr nodes are considered part of an Element's subtree. This event is dispatched after the insertion has taken place. The target node of this event is the node being inserted. If the node is being directly inserted, the event type DOMNodeInserted occurs before this event type.
Title | Value |
---|---|
Cancelable | No |
Bubbles | Yes |
Target | Element, Attr, Text, Comment, CDATASection, DocumentType, EntityReference, ProcessingInstruction |
Context info | None |
See also
DOM 2 Events DOMNodeRemoved | Constant |
public static const DOMNodeRemoved:String = DOMNodeRemoved
Introduced in: | DOM 2 Events |
A node is being removed from its parent node or, in case of Attr nodes, removed from its ownerElement. This event is dispatched before the removal takes place. The target node of this event is the node being removed.
Title | Value |
---|---|
Cancelable | No |
Bubbles | Yes |
Target | Element, Attr, Text, Comment, CDATASection, DocumentType, EntityReference, ProcessingInstruction |
Context info | MutationEvent.relatedNode holds the parent node of the node being removed or, in case of Attr nodes, the ownerElement of the Attr node. |
See also
DOM 2 Events DOMNodeRemovedFromDocument | Constant |
public static const DOMNodeRemovedFromDocument:String = DOMNodeRemovedFromDocument
Introduced in: | DOM 2 Events |
A node is being removed from a document, either through direct removal of the node or removal of a subtree in which it is contained; Attr nodes are considered part of an Element's subtree. This event is dispatched before the removal takes place. The target node of this event type is the node being removed. If the node is being directly removed, the event type DOMNodeRemoved occurs before this event type.
Title | Value |
---|---|
Cancelable | No |
Bubbles | Yes |
Target | Element, Attr, Text, Comment, CDATASection, DocumentType, EntityReference, ProcessingInstruction |
Context info | None |
See also
DOM 2 Events DOMSubtreeModified | Constant |
public static const DOMSubtreeModified:String = DOMSubtreeModified
Introduced in: | DOM 2 Events |
This is a general event for notification of all changes to the document.
It can be used instead of the more specific mutation and mutation name events listed below. It may be dispatched after a single modification to the document or, at the implementation's discretion, after multiple changes have occurred. The latter use should generally be used to accommodate multiple changes which occur either simultaneously or in rapid succession. The target of this event is the lowest common parent of the changes which have taken place. This event is dispatched after any other events caused by the mutation(s) have occurred.
Title | Value |
---|---|
Cancelable | No |
Bubbles | Yes |
Target | Document, DocumentFragment, Element, Attr |
Context info | None |
See also
DOM 2 Events MODIFICATION | Constant |
public static const MODIFICATION:Number = 1
Introduced in: | DOM 2 Events |
The Attr was modified in place.
See also
DOM 2 Events REMOVAL | Constant |
public static const REMOVAL:Number = 3
Introduced in: | DOM 2 Events |
The Attr was just removed.
See also