dotdot-mask
v1.2.2
Published
A better mask for your HTML inputs. Add a dot every 3 integers in numeric form fields.
Downloads
7
Maintainers
Readme
dotdot
This script masks an input field by adding a dot every three digits starting from the last integer and allowing only numbers to be typed in.
You can use it with both vanilla JavaScript and jQuery, although jQuery is NOT required. Simply pass your selector(s) like this:
var elems = document.getElementsByTagName('input')
Dotdot(elems);
// or...
var elems = $('#myElem');
Dotdot(elems);
Get it with npm:
npm i dotdot-mask
Look in the demo/
folder for an example or check this bin.