Help Center

Local Navigation

Object: MutationEvent

Availability

BlackBerry® Device Software 4.6 to 5.0

Extends

Event

The MutationEvent object extends the Event object and represents an event generated when the structure of document is modified. To create an instance of a MutationEvent, you must invoke Document.createEvent() with an input parameter of "MutationEvent".

To improve the performance of the browser, support for mutation events has been removed in in BlackBerry 6.

Mutation event types

Event type

Bubbles

Cancelable

Description

DOMAttrModified

yes

yes

Occurs when Attr.value has been modified on a node, or when an Attr node has been added or removed. The EventTarget is the Element node to which the Attr is attached.

This event type includes the following context information:

  • MutationEvent.attrName
  • MutationEvent.attrChange
  • MutationEvent.newValue
  • MutationEvent.prevValue
  • MutationEvent.relatedNode

DOMCharacterDataModified

yes

no

Occurs when CharacterData.data or ProcessingInstruction.data have been modified on a node. The EventTarget is the CharacterData node or ProcessingInstruction node.

This event type includes the following context information:

  • MutationEvent.newValue
  • MutationEvent.prevValue

DOMContentLoaded

no

no

Occurs when the BlackBerry® Browser has completely parsed the document, before any onload events are triggered.

DOMNodeInserted

yes

no

Occurs when a node has been added as a child of another node, or if an Attr node has been added to an Element node.

This event type includes the following context information:

  • MutationEvent.relatedNode

DOMNodeInsertedIntoDocument

yes

no

Occurs when a node has been inserted into the document, either directly or as part of a subtree.

DOMNodeRemoved

yes

no

Occurs when a node has been removed from another node, or if an Attr node has been removed from its Element node.

This event type includes the following context information:

  • MutationEvent.relatedNode

DOMNodeRemovedFromDocument

yes

no

Occurs when a node has been removed from the document, either directly or as part of a subtree.

DOMSubtreeModified

yes

no

Occurs when any modification has been made to the document, encompassing all other MutationEvent types.

MutationEvent properties

Property name

Type

Description

Status

Availability

attrChange

unsigned short

Returns the type of change that triggered the DOMAttrModified event. This property can return one of the following values:

  • 1 = MODIFICATION: An existing Attr object was modified in place.
  • 2 = ADDITION: A new Attr object was added to the DOM.
  • 3 = REMOVAL: An Attr object was removed from the DOM.

read only

4.6 or later

attrName

DOMString

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

read only

4.6 or later

newValue

DOMString

Returns the new value of:

read only

4.6 or later

prevValue

DOMString

Returns the previous value of:

read only

4.6 or later

relatedNode

Node

Returns the secondary node affected by a mutation event.

read only

4.6 or later

Property name

Type

Description

Status

Support level

Availability

attrChange

unsigned short

Returns the type of change that triggered the DOMAttrModified event. This property can return one of the following values:

  • MODIFICATION
  • ADDITION
  • REMOVAL

read only

DOM 2 Events

4.6 or later

attrName

DOMString

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

read only

DOM 2 Events

4.6 or later

newValue

DOMString

Returns the new value of:

  • the Attr node in a DOMAttrModified event

  • the CharacterData node in a DOMCharacterDataModified event

read only

DOM 2 Events

4.6 or later

prevValue

DOMString

Returns the previous value of:

  • the Attr node in a DOMAttrModified event

  • the CharacterData node in a DOMCharacterDataModified event

read only

DOM 2 Events

4.6 or later

relatedNode

Node

Returns the secondary node affected by a mutation event.

read only

DOM 2 Events

4.6 or later

MutationEvent methods

Method name

Description

Support level

Availability

initMutationEvent()

Initializes the value of a MutationEvent.

DOM 2 Events

4.6 or later

Next topic: Object: TextEvent
Previous topic: MouseEvent methods

Was this information helpful? Send us your comments.