StopPropagation

From Svg wiki

Contents

Description

The stopPropagation method the event, preventing further upward bubbling of the event. This means that no event listeners higher up in the document hierarchy will receive this event.

Warning: In many script implementationsstopPropagation also seems to prevent any default actions for this event by the UA, such as the activation of the right-click context menu. It is not clear that this should be the case from DOM3, which indicates that preventDefault should be used to do that.

Type

Method

Parameters

None

Methods

None

Return Value

None

Related Methods and Objects

Examples

This example will

function StopBubbling( evt )
{
  // get the immediate target of this event
  var firstTarget = evt.target;

  // stop all other targets with event listeners from 
  // triggering this event
  evt.stopPropagation();
}

Implementation Support

Specification Reference

DOM3 Events