A prevent-default decorator for DOM listeners
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README.md
package.json
prevent-default.js

README.md

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);