Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Event.stopPropagation()

翻譯不完整。請協助 翻譯此英文文件

阻止呼叫此方法的事件物件繼續捕捉或冒泡傳遞。

語法

event.stopPropagation();

範例

See Example 5: Event Propagation in the Examples chapter for a more detailed example of this method and event propagation in the DOM.

備註

See the DOM specification for the explanation of event flow. (The DOM Level 3 Events draft has an illustration.)

preventDefault is a complementary method that can be used to prevent the default action of the event from happening.

規範

Specification Status Comment
DOM
The definition of 'Event.stopPropagation()' in that specification.
Living Standard  
DOM4
The definition of 'Event.stopPropagation()' in that specification.
Recommendation  
Document Object Model (DOM) Level 2 Events Specification
The definition of 'Event.stopPropagation()' in that specification.
Recommendation Initial definition

瀏覽器相容性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes) (Yes) 9 (Yes) (Yes)
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support (Yes) (Yes) ? (Yes) (Yes)

文件標籤與貢獻者

 此頁面的貢獻者: jackblackevo
 最近更新: jackblackevo,