prevent-default

Prevent-default decorator for DOM listeners

npm install prevent-default
7 downloads in the last week
79 downloads in the last month

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);
npm loves you