How to validate mobile number in html? (mobile number validation in html w3schools)

Today, We want to share with you mobile number validation in html w3schools.In this post we will show you input type for mobile number in html, hear for 10 digit mobile number validation in javascript w3schools we will give you demo and example for implement.In this post, we will learn about How To Allow Only 10 Digit Mobile Number Validation Using Javascript With Jquery with an example.

html code for phone number format

Phone numbers from India are 10 digits long, and start with 7, 8, or 9.

Also Read This πŸ‘‰   Golang Ints function sort slice ascending or descending

For example:

These phone numbers are valid, but


are invalid.

Minimum digits 10
Maximum digits 10
number starts with 7,8,9


html phone number input

Example 1:

The <input type="tel"> defines a field for entering a telephone number. Note: Browsers that do not support "tel" fall back to being a standard "text" input. 

Tip: Always add the <label> tag for best accessibility Examples!

Define a field for entering a telephone number:

<label for="phone">Enter your phone number:</label>
<input type="tel" id="phone" name="phone" pattern="[0-9]{3}-[0-9]{2}-[0-9]{3}">

HTML5 phone number validation with pattern

Example 2: /(7|8|9)\d{9}/

<input type="text" pattern="[789][0-9]{9}">

Example 3:

<input type="text" name="Phone Number" pattern="[7-9]{1}[0-9]{9}" 
       title="Phone number with 7-9 and remaing 9 digit with 0-9">

I hope you get an idea about html input pattern numbers only.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.