Vanilla JavaScript Plugin

Cleave.js  

Format text input fields while typing, e.g. for date/time, credit card number, thousands separator, or decimal mark.

Plugin Website  Demo