Skip to content

segmentio/prevent-default

 
 

Repository files navigation

prevent

Note
Segment has paused maintenance on this project, but may return it to an active status in the future. Issues and pull requests from external contributors are not being considered, although internal contributions may appear from time to time. The project remains available under its open source license for anyone to use.

CircleCI Codecov

Cross-browser preventDefault

Installation

$ npm install @segment/prevent-default

Example

anchor.onclick = require('prevent');
anchor.onclick = function(e){
  if (something) return require('prevent')(e);
};

API

prevent(e)

Prevent the given e, if the argument is omitted, the method will fallback to window.event.

About

Cross browser prevent default, because microsoft is awesome.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 68.5%
  • Makefile 31.5%