Well, I've created a form and a field for the user to fill in the phone. That is: field type="tel". What I want is a JavaScript code that, when the user inserts the phone, the code will automatically transform the phone to this format (xx) xxxx-xxxx. In short, I want the code to automatically populate the parentheses, space, and hifen, leaving the phone like this:
(xx) xxxx-xxxx
Note: respecting the parentheses, the space and the hyphen.
Another question: can you do this with HTML itself?
If you can, post the part of the HTML in which I call the method, as I have not studied JavaScript yet. Thank you.