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 2015å¹´7æ.
æ¦è¿°
表示äºä»¶æ¯å¦æåä¸å泡å³éã
èªæ³
var bool = event.bubbles;
åå³ä¸å叿å¼ï¼è¥äºä»¶æåä¸å泡å³éååå³ trueã
å註
Only certain events can bubble. Events that do bubble have this property set to true. You can use this property to check if an event is allowed to bubble or not.
ç¯ä¾
js
function goInput(e) {
// checks bubbles and
if (!e.bubbles) {
// passes event along if it's not
passItOn(e);
}
// already bubbling
doOutput(e);
}
è¦ç¯
| Specification |
|---|
| DOM > # ref-for-dom-event-bubbles⢠> |