Skip to content

Copy of jquery.maskedinput, but without the jquery dependency

License

Notifications You must be signed in to change notification settings

n8jadams/maskedinput-nojquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

maskedinput-nojquery

This is literally a copy of jquery.maskedinput, but without the dependency on jquery.

Slightly different API

maskedinput.mask()

Arguments:

  1. HTMLElement, NodeList, or HTMLCollection
  2. Mask (same as first argument of $('.some-selector').mask())
  3. Options (optional, same as second argument of $('.some-selector').mask())

Usage Example:

maskedinput.mask(document.getElementById('phone'), '999-999-9999', { autoclear: false });

maskedinput.unmask()

Arguments:

  1. HTMLElement, NodeList, or HTMLCollection

Usage Example:

maskedinput.unmask(document.getElementsByClassName('phones'));

maskedinputVars.definitions (mutable)

Usage Example:

maskedinputVars.definitions['~']='[+-]';
maskedinput.mask(document.getElementById('masked-input'), "~9.99 ~9.99 999");

Notes

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.

About

Copy of jquery.maskedinput, but without the jquery dependency

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published