Event.bubbles
bubbles は Event インターフェイスの読み取り専用プロパティで、イベントが DOM ツリーをバブリングするかしないかを示します。
メモ: バブリングについての詳細は、イベントのバブリングとキャプチャを参照してください。
値
論理値で、このイベントが DOM ツリーをバブリングするのであれば true です。
例
js
function handleInput(e) {
// Checks whether the event bubbles and ...
if (!e.bubbles) {
// ... passes the event along if does not
passItOn(e);
}
// Already bubbling
doOutput(e);
}
仕様書
| Specification |
|---|
| DOM Standard # ref-for-dom-event-bubbles③ |
ブラウザーの互換性
BCD tables only load in the browser
関連情報
stopPropagation()はイベントのバブリングを停止しますstopImmediatePropagation()は同じイベントが DOM 内の同じ水準で他のリスナーを呼び出すことを抑止しますpreventDefault()は拡散を続けることを許可しますが、ブラウザーがイベントを扱うためのリスナーがない既定のアクションを実行することを許可しません