When the user presses Enter, than java Script checks that phone number is valid or not.
intl-tel-input is a popular j Query plugin for entering and validating international telephone numbers.
In Java Script, regular expressions are also objects.
These patterns are used with the exec and test methods.
Everyone must have filled an online form at some stage, a form usually asks for information related to name, phone no, address, credit-card no etc.
Incase you didn't provide information in the format specified by the form field or leave it empty, the message will appear and form cannot be submitted until you get it right.