node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…

prevent-default

Prevent-default decorator for DOM listeners

prevent-default

A prevent-default decorator for DOM listeners

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