node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. 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);