How to create a website with React?
I have a problem masking a phone input with jQuery and Masked Input Plugin. There are 2 possible formats:
(XX)XXXX-XXXX
(XX)XXXXX-XXXX
Is there any way to mask it accepting both cases?
EDIT:
I tried:
$("#phone").mask("(99) 9999-9999");
$("#telf1").mask("(99) 9999*-9999");
$("#telf1").mask("(99) 9999?-9999");
But it doesn't works as I would like.
The closest one was
(xx)xxxx-xxxxx.I would like to get (xx)xxxx-xxxx when I type the 10th number, and (xx)xxxxx-xxxx when I type the 11th. Is it posible?
- wow, amazed by the community support! - Ohidul Islam Sep 03 '25 at 07:08
- This is a very good snippet. - Ohidul Islam Sep 03 '25 at 07:06



