JavaScript Regular Expressions in JavaScript Reformatting User Input Reformatting a Telephone Number

Brian Foley
Brian Foley
8,439 Points

reformatting won't reformat :(

Unfortunately my regex code isn't reformatting the telephone number and I can't see why. Any ideas? Here's a snapshot: https://w.trhou.se/w4xcpcpzf9

1 Answer

Christopher Kellett
Christopher Kellett
7,053 Points

Brian,

It seems you have a typo on line 80:

//e.taget.value = formatTelephone(e.target.value);
e.target.value = formatTelephone(e.target.value);

Hope that's helpful.

Brian Foley
Brian Foley
8,439 Points

lol "taget". Thank you!