Press "Enter" to skip to content

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.

auto format phone number input field, phone number field format, html code for phone number format, phone number field validation, phone number input masking

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" 

3. Add a prefix to the formatted value.

<input class="masked prefixed" 
       data-pattern="+**(***) *(**)-**-**" 
       placeholder="+99(888) 1(23)-45-67" />

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

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.

Be First to Comment

    Leave a Reply

    Your email address will not be published.