Jquery在输入字段上键入US移动号码时生成自动连字符

I am using jquery validator plugin when i type us code on my page i need to generate hyphen automatically after 3 digit, the jquery code that I am currently using is and it allow only when use enter mobile number in this format(000-000-0000)

customphone: function(value, element) {
   return this.optional(element) || /^\d{3}-\d{3}-\d{4}$/.test(value);
},

But the problem is i manually type the hyphen but and i want to generate that hyphen automatically....Could anyone please help me..

You can try input mask plugin

Just you need to use,

<input data-inputmask="'mask': '999-999-999'">

Demo Page