node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

prevent-default

prevent-default

A prevent-default decorator for DOM listeners

Example

var listener = preventDefault(function(ev) {
  alert("Default prevented! "+ev.defaultPrevented);
});
 
document.getElementsByTagName('body')[0].addEventListener("click", listener);