This version is below version 1.0.0 and some unexpected behaviors may occur.
npm i automask
Just import with require and use:
Download script into /dist/web/ folder and import normally:
All settings are usable on HTML and works on IE11+ browsers.
<!-- MAC Address --><!-- show the empty mask --><!-- Percentage --><!-- Money -->
All AutoMask settings are enabled with HTML. Just set the attribute and use.
maskto define your pattern;
prefixto set an prefix;
suffixto set an suffix;
show-maskto set whether or not to display the mask;
acceptRegular Expression for accepted characters (default is only numbers);
persistRegular Expression to set what characters submit on form.
dirto set fill direction;
The mask accepts all characters and have only two special characters, the
These characters are where your value will stay, and the
0 will works like an zero pad (for example, to pad the money or percentage).
dir set the completion direction. Accept two values,
forward. The default value is
- Created and maintained by Emerson C. Romaneli (@ECRomaneli).