Skip to content

stopBubble

Stop event bubbling.

Usage

js
import { stopBubble } from 'js-cool'

Signature

typescript
function stopBubble(e: Event): void

Parameters

ParameterTypeDescription
eEventEvent object

Examples

js
document.getElementById('child').addEventListener('click', (e) => {
  stopBubble(e)
  console.log('Event won\'t bubble to parent')
})

Released under the MIT License.