javascript or jquery Input text number only and auto masking
问题 I use javascript and jquery. I want to make a masking template for <input type="text"> Which accept numbers only and auto masking format for every number keyup result. The masking format is : 99-99-99-99-[repeat format until last inputed number] Examples for valid input and result : Inputed : 001234567890 Result : 00-12-34-56-78-90- Inputed : 00[backspace]1234567890 Result : 01-23-45-67-89-0 Inputed : 00[backspace]1234567890 Result : 01-23-45-67-89-0 My current complete html working script