Export (0) Print
Expand All

stopPropagation method

Prevents propagation of an event beyond the current target.

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

 

Syntax


HRESULT retVal = object.stopPropagation();

Parameters

This method has no parameters.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Standards information

Remarks

You can stop event propagation in the capturing or bubbling event phase by calling the IDOMEvent::stopPropagation method. However, the event dispatchs to all event listeners on the current target (regardless of capturing or bubbling) before the event flow stops. To completely prevent any remaining handlers from running, use the IDOMEvent::stopImmediatePropagation method instead.

The IDOMEvent::stopPropagation method is similar to the IHTMLEventObj::cancelBubble event property of Windows Internet Explorer 8 and earlier versions.

See also

Reference
IDOMEvent::eventPhase
IDOMEvent::stopImmediatePropagation

 

 

Community Additions

ADD
Show:
© 2014 Microsoft