Event: bubbles プロパティ
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
メモ: この機能はウェブワーカー内で利用可能です。
bubbles
は Event
インターフェイスの読み取り専用プロパティで、イベントが DOM ツリーをバブリングするかしないかを示します。
メモ: バブリングについての詳細は、イベントのバブリングを参照してください。
値
論理値で、このイベントが DOM ツリーをバブリングするのであれば true
です。
例
js
function handleInput(e) {
// バブリングするイベントを渡すかどうかをチェック
if (!e.bubbles) {
passItOn(e);
}
// 既にバブリングした
doOutput(e);
}
仕様書
Specification |
---|
DOM # ref-for-dom-event-bubbles③ |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bubbles |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
関連情報
stopPropagation()
はイベントのバブリングを停止しますstopImmediatePropagation()
は同じイベントが DOM 内の同じ水準で他のリスナーを呼び出すことを抑止しますpreventDefault()
は拡散を続けることを許可しますが、ブラウザーがイベントを扱うためのリスナーがない既定のアクションを実行することを許可しません