Imagine this: there you are, minding your own business, coding your time away. And then someone walks in and asks you to build an input mask for mobile applications using pure JavaScript (no external libraries!).

And you’re thinking that building an input mask is not that hard. All you need to do is create a bunch of functions to validate the key using keyboard events and cancel the event when the key is not allowed. How hard can it be?

Famous last words. (more…)