1.2.2 • Published 9 years ago

dotdot-mask v1.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

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.