@jsxtools/prevent-default
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

prevent-default

npm version build status issue tracker pull requests

prevent-default returns a function that invokes preventDefault on any event passed into it.

It is 191 bytes (145 gzipped).

Installation

npm install @jsxtools/prevent-default

Usage

import preventDefault from '@jsxtools/prevent-default';

document.querySelector('form').addEventListener('submit', preventDefault(() => {
  // handle submission via JS without submission
}));

Readme

Keywords

none

Package Sidebar

Install

npm i @jsxtools/prevent-default

Weekly Downloads

1

Version

1.0.6

License

CC0-1.0

Unpacked Size

9.81 kB

Total Files

7

Last publish

Collaborators

  • jonathantneal