How can I mask a HTML input text with a mask for phone number?
Here in Brazil, in some states, the number format can change. For example:
(dd)xxxx-xxxx this is the default number format, where dd is the state code, and the x's are the numbers.
BUT, in some states, the number nine is added to the phone number, like this: (dd)9xxxx-xxxx. (let's call it "new format")
the var dd isn't important, what I want to do is when the user type the new format, the hyphen automatically appears after the 4th X.