Elementals.js

Latest Version: 2.0 RC 3 14 March 2017

Method _.eventPrevent

Summary:

Prevents the passed 'Event' object from bubbling or propagating.

Calling Convention:
_.eventPrevent(Event)
Parameters:
Event
The Event object you wish to prevent from bubbling or propagating.
Returns:
Nothing
Actions taken:
  • Set Event.cancelBubble to true
  • Set Event.returnValue to false
  • If browser supports Event.stopPropagation, do that.
  • If browser supports Event.preventDefault, do that too!

All of the above is probably overkill, but when dealing with cross browser and wanting your handler to be the ONLY handler for an event, overkill is a good thing.