How to remove line 8-ku if introduced her at the beginning?

Good morning all!
Prompt how to implement, if during a input-s started enter your phone 8 you need to remove
I tried sobut was not released
August 19th 19 at 22:54
1 answer
August 19th 19 at 22:56
Solution
$('.input_telefon').keyup(function () {
 var vals = $('.input_telefon').val();
$('.input_telefon').val(vals.replace(/^8/,"));
});

in General, I would advise to use the input mask masked-input
Thank you) - trevor.Hoppe51 commented on August 19th 19 at 22:59
The mask is used just still introduced 8 first - trevor.Hoppe51 commented on August 19th 19 at 23:02
: Hmm, cool, didn't know. Try - trevor.Hoppe51 commented on August 19th 19 at 23:05
: codepen.io/DenisBardak/pen/apqoGv - Thalia_Schowalter73 commented on August 19th 19 at 23:08
And I almost did as https://www.tinkoff.ru/ but perhaps I will leave your option, thanks again) - trevor.Hoppe51 commented on August 19th 19 at 23:11
: add to the beginning of +7 and 8 I think to enter, no one will try - Thalia_Schowalter73 commented on August 19th 19 at 23:14
: Unfortunately, these are customers lost - trevor.Hoppe51 commented on August 19th 19 at 23:17
: well, I mean to the mask on codepen added, although at that place are always 9) - Thalia_Schowalter73 commented on August 19th 19 at 23:20

Find more questions by tags JavaScriptjQuery