This is literally a copy of jquery.maskedinput, but without the dependency on jquery.
- HTMLElement, NodeList, or HTMLCollection
- Mask (same as first argument of
$('.some-selector').mask()
) - Options (optional, same as second argument of
$('.some-selector').mask()
)
Usage Example:
maskedinput.mask(document.getElementById('phone'), '999-999-9999', { autoclear: false });
- HTMLElement, NodeList, or HTMLCollection
Usage Example:
maskedinput.unmask(document.getElementsByClassName('phones'));
Usage Example:
maskedinputVars.definitions['~']='[+-]';
maskedinput.mask(document.getElementById('masked-input'), "~9.99 ~9.99 999");
I did this to keep myself occupied on a flight from London to Salt Lake City. It seems like this works like the original library, but if I missed something (which I probably did...) feel free to add an issue or a pull request.