98
imaskjs - vanilla javascript input mask
source link: https://unmanner.github.io/imaskjs/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Javascript Input Mask
Features
- get and set value and unmasked value easily
- no external dependencies
- supports overwrite mode
- supports all major browsers
- supports web components
- supports contenteditable
- RegExp mask
- Function mask
- Number mask (integer and decimal support)
- Date mask (with various format support and autofix mode)
- Dynamic/on-the-fly mask
- Pattern mask
- show placeholder always or when needed
- unmasked value can contain fixed parts
- optional input parts
- custom definitions
- reusable blocks
- Enum and Range masks
- convert and format values with pipe
Plugins
RegExp (Russian postal code) /^[1-6]\d{0,5}$/
source
Pattern (Phone) +{7}(000)000-00-00
source
Number in range [-10000, 10000]
source
Date 'dd.mm.yyyy' in range [01.01.1990, 01.01.2020]
source
On-the-fly select phone or email
source
Mask in mask currency input
source
Pipe unmasked → masked
source
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK