HTML Code for Phone Number Input Field Format | input-mask.js

Input mask is a small JavaScript library that automatically formats input values such as phone numbers and zip codes as you type.

How to make use of it:

1. Download and embrace the input-mask.js JS library on the web page.

<script src=”./js/input-mask.js”></script>

2. Define your individual 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" />

Real-time Input Field Formatting, vanilla js input mask Plugin/Github, phone number pattern in html

Read More – 

Simple Input Mask and Validation Plugin | jquery.maskedinput
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.

Share