A Free jQuery plugin with Input Mask plugin is a lightweight and easy to use with JavaScript/jQuery plugin. It makes it easier to use and create an input mask. An input mask helps the user side with the input by predefined format. This can be useful for dates, numeric, phone numbers, email-address etc.
Table of Contents
How To Use:
Add jQuery after add Input Mask plugin.
<!-- As A Vanilla JS Plugin -->
<script src="/path/to/dist/inputmask.min.js"></script>
<!-- As A jQuery Plugin -->
<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/dist/jquery.inputmask.min.js"></script>
<!-- Allows data-input attribute -->
<script src="/path/to/dist/bindings/inputmask.binding.js"></script>
Use data-inputmask-<the name of the option>=”value”
<input data-inputmask="'alias': 'date'" />
<div contenteditable="true" data-inputmask="'mask': '9', 'repeat': 10, 'greedy' : false"></div>
<textarea data-inputmask="'mask': '99-9999999'" /></textarea>
Add Script plugin on the target element.
$("Selector").inputmask();
$("Selector").inputmask("99-9999999");
Default masking definitions.
- 9: numeric
- a: alphabetical
- *: alphanumeric
Predefined mask alias.
- datetime
- numeric
- cssunit
- url
- IP
- mac
- vin
Done
Thanks for make jQuery plugin is developed by For more Helpfull for users, please check the demo page or visit the official website.