mask-input
Version:
Mask input component. Allow to input formatted values with fixed length or apply custom formatting function, to format values with any length
12 lines (9 loc) • 318 B
JavaScript
import PlainMaskInput from '../src/MaskInput';
const MaskInput = new PlainMaskInput(document.querySelector('.js-input'), {
mask: '0000-0000-0000-0000',
});
const MaskInput2 = new PlainMaskInput(document.querySelector('.js-input-mask'), {
mask: '0000-0000-0000-0000',
alwaysShowMask: true,
maskChar: '_',
});