JavaScript function that makes input HTML element accept mask pattern
npm install vanilla-text-maskNote: IE9 is not supported in this module.
First, install it.
``bash`
npm i vanilla-text-mask --save
Then, use it as follows:
`html`
type="text/javascript"
src="./node_modules/vanilla-text-mask/dist/vanillaTextMask.js">
As you can see in the code above, you are passing an object to vanillaTextMask.maskInput(...).
The object takes inputElement, which is the element that you are masking. It also
accepts other values which are
documented here.
To see an example of the code running, follow these steps:
1. Clone the repo, git clone git@github.com:text-mask/text-mask.gitcd text-mask
1. npm install
1. npm run vanilla:dev
1.
1. Open http://localhost:3000
The code of the example is in vanilla/example`.
We would love some contributions! Check out this document to get started.