html - How to validate phone number in javascript -


this question has answer here:

how can format script , input show 10 numbers , have characters of ( ) , + @ start of number? thanks.

you can use patern attribute like:

<input type="phone" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" required=""> 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -