Input mask is a small JavaScript library that automatically formats input values such as phone numbers and zip codes as you type.
Noticeable. The number of characters in a pattern is the number of characters that can be entered.
Must Read: Javascript Library That Identifies, Validates, and Formats Phone Numbers | front.phone
input-mask.js Details
Post Name | HTML Code for Phone Number Format |
Author Name | AlexZaw |
Category | Form Plugins |
Official Page | Click Here |
Official Website | github.com |
Publish Date | August 25, 2021 |
Last Update | August 4, 2023 |
Download | Link Below |
License | MIT |
How to make use of it:
1. Download the input-mask.js
JS library on the web page.
<script src=”./js/input-mask.js”></script>
2. Define your format sample within the data-pattern
attribute.
<input class="masked" type="tel" data-pattern="+*(***)***-**-**" placeholder="+1(234)567-89-10">
3. Add a prefix to the formatted value.
<input class="masked prefixed" type="tel" data-pattern="+**(***) *(**)-**-**" data-prefix="+99(888)" placeholder="+99(888) 1(23)-45-67" />
Read More –
International Telephone Input With Flags And Dial Codes Library
[Dial Codes] Entering and Validating International Telephone Input With Flags
Library for Handling Phone Input Field in Web Form | phonemask
See Demo And Download

Official Website(AlexZaw): Click Here
This superior jQuery/javascript plugin is developed by AlexZaw. For extra advanced usage, please go to the official website.