Packagedom.events
Classpublic class MutationEvent
InheritanceMutationEvent Inheritance Event Inheritance Object
Subclasses MutationNameEvent

Introduced in: DOM 2 Events 
Modified in: DOM 3 Events 

The MutationEvent interface provides specific contextual information associated with Mutation events.

To create an instance of the MutationEvent interface, use the DocumentEvent.createEvent("MutationEvent") method call.

See also

W3C - MutationEvent


Public Properties
 PropertyDefined 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
 InheritedDOM 2 Events bubbles : Boolean
[read-only] Used to indicate whether or not an event is a bubbling event.
Event
 InheritedDOM 2 Events cancelable : Boolean
[read-only] Indicates whether the event is cancelable or not.
Event
 InheritedDOM 2 Events currentTarget : EventTarget
[read-only] Identifies the current target for the event, as the event traverses the DOM.
Event
 InheritedDOM 3 Events defaulPrevented : Boolean
[read-only] Used to indicate whether Event.preventDefault() has been called for this event.
Event
 InheritedDOM 2 Events eventPhase : Number
[read-only] Used to indicate which phase of event flow is currently being accomplished.
Event
 InheritedNon-Standard explicitOriginalTarget : nsIDOMEventTarget
[read-only] The explicit original target of the event.
Event
 InheritedNon-Standard isTrusted : Boolean
[read-only] Determines if the event was from the user or script generated.
Event
 InheritedDOM 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
 InheritedNon-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
 InheritedDOM 2 Events target : EventTarget
[read-only] Used to indicate the event target.
Event
 InheritedDOM 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
 InheritedDOM 2 Events type : DOMString
[read-only] The local name of the event type.
Event
Public Methods
 MethodDefined By
 Inherited
DOM 2 Events initEvent(typeArg:DOMString, canBubbleArg:Boolean, cancelableArg:Boolean):void
Initializes attributes of an Event created through the DocumentEvent.createEvent method.
Event
 Inherited
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
 Inherited
 Obsolete preventBubble():void
Prevents the event from bubbling.
Event
 Inherited
 Obsolete preventCapture():void
This method is deprecated in favor of standard stopPropagation and is removed in Gecko 1.9.
Event
 Inherited
DOM 2 Events preventDefault():void
Cancels the event if it is cancelable, without stopping further propagation of the event.
Event
 Inherited
DOM 3 Events stopImmediatePropogation():void
Prevents other event listeners from being triggered and, unlike Event.stopPropagation() its effect is immediate .
Event
 Inherited
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
Public Constants
 ConstantDefined By
 InheritedHTML 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
 InheritedDOM 2 Events AT_TARGET : Number = 2
[static] The current event is in the target phase, i.e.
Event
 InheritedDOM 2 Events BUBBLING_PHASE : Number = 3
[static] The current event phase is the bubbling phase.
Event
 InheritedDOM 2 Events CAPTURING_PHASE : Number = 1
[static] The current event phase is the capture phase.
Event
 InheritedHTML 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
 InheritedHTML 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
 InheritedHTML 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
 InheritedHTML 4.0 reset : String = reset
[static] A form, such as a [HTML 4.01] or [XHTML 1.0] form, is reset.
Event
 InheritedHTML 4.0 select : String = select
[static] A user selects some text.
Event
 InheritedHTML 4.0 submit : String = submit
[static] A form, such as a [HTML 4.01] or [XHTML 1.0] form, is submitted.
Event
 InheritedHTML 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
Property Detail
DOM 2 Events attrChangeproperty
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.


Implementation
    public function get attrChange():Number

See also

DOM 2 Events attrNameproperty 
attrName:DOMString  [read-only]

Introduced in: DOM 2 Events 

Indicates the name of the changed Attr node in a DOMAttrModified event.


Implementation
    public function get attrName():DOMString

See also

DOM 2 Events newValueproperty 
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.


Implementation
    public function get newValue():DOMString

See also

DOM 2 Events prevValueproperty 
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.


Implementation
    public function get prevValue():DOMString

See also

DOM 2 Events relatedNodeproperty 
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.


Implementation
    public function get relatedNode():Node

See also

Method Detail
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

Constant Detail
DOM 2 Events ADDITIONConstant
public static const ADDITION:Number = 2

Introduced in: DOM 2 Events 

The Attr was just added.

See also

DOM 2 Events DOMAttrModifiedConstant 
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.

TitleValue
CancelableNo
BubblesYes
TargetElement
Context infoMutationEvent.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 DOMCharacterDataModifiedConstant 
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.

TitleValue
CancelableNo
BubblesYes
TargetText, Comment, CDATASection, ProcessingInstruction
Context infoMutationEvent.prevValue, and MutationEvent.newValue are in use.

See also

DOM 2 Events DOMNodeInsertedConstant 
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.

TitleValue
CancelableNo
BubblesYes
TargetElement, Attr, Text, Comment, CDATASection, DocumentType, EntityReference, ProcessingInstruction
Context infoMutationEvent.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 DOMNodeInsertedIntoDocumentConstant 
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.

TitleValue
CancelableNo
BubblesYes
TargetElement, Attr, Text, Comment, CDATASection, DocumentType, EntityReference, ProcessingInstruction
Context infoNone

See also

DOM 2 Events DOMNodeRemovedConstant 
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.

TitleValue
CancelableNo
BubblesYes
TargetElement, Attr, Text, Comment, CDATASection, DocumentType, EntityReference, ProcessingInstruction
Context infoMutationEvent.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 DOMNodeRemovedFromDocumentConstant 
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.

TitleValue
CancelableNo
BubblesYes
TargetElement, Attr, Text, Comment, CDATASection, DocumentType, EntityReference, ProcessingInstruction
Context infoNone

See also

DOM 2 Events DOMSubtreeModifiedConstant 
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.

TitleValue
CancelableNo
BubblesYes
TargetDocument, DocumentFragment, Element, Attr
Context infoNone

See also

DOM 2 Events MODIFICATIONConstant 
public static const MODIFICATION:Number = 1

Introduced in: DOM 2 Events 

The Attr was modified in place.

See also

DOM 2 Events REMOVALConstant 
public static const REMOVAL:Number = 3

Introduced in: DOM 2 Events 

The Attr was just removed.

See also