Maskfy (2.0.0) - Input Mask Simple
A Javascript library without a dependency of jQuery, Zepto, and etc ... Very simple to install and use. With only 1kb (gzip) code, IE Compatibility, it's also well accepted on mobile devices
Install / Usage
Add Maskfy file
or
HTML (by class or attribute)
Insert a selector in class tag
or
Javascript Options
<script> tag: '[data-maskfy]' //{String: undefined} (required) selector input mask: '999.999.999,99' //{String: undefined} (required) input mask pattern reverse: true //{Boolean: false} reverse typing minSize: 3 //{Number: false} minimum digits defaultValue: '123' //{String: undefined} initial value letters: true //{Boolean: false} allowed letters console //{Function: undefined} after input event ;</script>
HTML attributes [data-*]
If necessary, you could add attributes in the tag, to configure your mask options
data-maskfy
data-maskfy-reverse
data-maskfy-minsize
data-letters
default value
Source
Github | npm | React | Example | @figuarnieri
License
The MIT License Copyright 2018 © Filipe Guarnieri