mirror of
https://github.com/tenrok/maska.git
synced 2026-06-20 20:00:34 +03:00
Update docs about usage with vanilla js
This commit is contained in:
@@ -67,6 +67,20 @@ Just load script `maska.js` and init it, passing element(s) or `document.querySe
|
|||||||
var mask = Maska.create('.masked');
|
var mask = Maska.create('.masked');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Mask could be set as `data-mask` attribute on element:
|
||||||
|
|
||||||
|
``` html
|
||||||
|
<input data-mask='##/##/####'>
|
||||||
|
```
|
||||||
|
|
||||||
|
or can be set by `mask` option on initialization:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var mask = Maska.create('.masked', {
|
||||||
|
mask: '##/##/####'
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
You can pass custom tokens while initialization:
|
You can pass custom tokens while initialization:
|
||||||
|
|
||||||
``` javascript
|
``` javascript
|
||||||
|
|||||||
Reference in New Issue
Block a user