Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nobitagit/dotdot

A better mask for your HTML inputs. Add a dot every 3 integers in numeric form fields.
https://github.com/nobitagit/dotdot

Last synced: about 1 month ago
JSON representation

A better mask for your HTML inputs. Add a dot every 3 integers in numeric form fields.

Awesome Lists containing this project

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:

```javascript
var elems = document.getElementsByTagName('input')
Dotdot(elems);

// or...
var elems = $('#myElem');
Dotdot(elems);

```

Get it with npm:
```js
npm i dotdot-mask
```

Look in the `demo/` folder for an example or check this [bin](http://jsbin.com/yateme/2).