MutationEvent object

Provides event properties that are specific to modifications to the Document Object Model (DOM) hierarchy and nodes.

Note  Mutation Events (W3C DOM Level 3 Events) have been deprecated in favor of Mutation Observers (W3C DOM4). For more info, see "Migrating mutation and property change events to Mutation Observers".

Document Object Model (DOM) Level 3 Events Specification, Section 5.2.8Internet Explorer 9

 

DOM Information

Inheritance Hierarchy

 Event
   MutationEvent

Members

The MutationEvent object has these types of members:

Methods

The MutationEvent object has these methods.

MethodDescription
initEvent

Initializes a new generic event that the createEvent method created.

initMutationEvent

Initializes a new DOM mutation (modification) event that the createEvent method created.

preventDefault

Cancels the default action of an event.

stopImmediatePropagation

Prevents any further propagation of an event.

stopPropagation

Prevents propagation of an event beyond the current target.

 

Properties

The MutationEvent object has these properties.

PropertyDescription

attrChange

Gets a value that indicates what type of change occurred.

attrName

Gets the name of the attribute that changed.

bubbles

Gets a value that indicates whether an event propagates up from the event target.

cancelable

Gets a value that indicates whether you can cancel an event's default action.

cancelBubble

Gets or sets a value that indicates whether an event should be stopped from propagating up from the current target.

currentTarget

Gets the event target that is currently being processed.

defaultPrevented

Gets a value that indicates whether the default action should be canceled.

eventPhase

Gets the event phase that is being evaluated.

isTrusted

Gets a value that indicates whether a trusted event source created an event.

newValue

Gets the new value of the attribute or text node.

prevValue

Gets the previous value of the attribute or text node.

relatedNode

Gets a second node related to a mutation event.

srcElement

Gets the element that the event was originally dispatched to. Compare to target.

target

Gets the element that is the target of the event.

timeStamp

Gets the time, in milliseconds, when an event occurred.

type

Gets the name of an event.

 

Standards information

Remarks

Mutation events occur when DOM nodes are inserted and removed, or when character data or attributes are modified. For more information, see initMutationEvent.

See also

"Mutation Observers"
MutationObserver

 

 

Show:
© 2014 Microsoft