js电话号码验证方法

PHPz
Release: 2018-09-28 17:39:15
forward
2336 people have browsed it

JS电话号码验证是比较常的一种验证,下边给出一个JavaScript验证电话号码的小例子。国内固定电话都是七位或8位的数字组成的,还可以带有长途的区号。

一般家用电话号码,如果不带区号就是7位或者8位数字的长度,而区号就是3位或者4位数字和一横。所以,我们在编写验证代码可以通过两条正则表达式进行电话号码验证。

  电话号码验证  
请输入电话号码:
Copy after login

家用电话号码JS验证:

以上就是本章的全部内容,更多相关教程请访问JavaScript视频教程

source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!