Home>Article>Web Front-end> JavaScript验证电子邮箱的函数_javascript技巧

JavaScript验证电子邮箱的函数_javascript技巧

WBOY
WBOY Original
2016-05-16 16:38:52 1599browse

本文介绍一个JavaScript验证电子邮箱的函数,相当靠谱。

JavaScript验证电子邮箱的函数,源代码如下:

function checkEmail(text) { if( text.match(/qq\.com$/) ) { return -1; } if( ! text.match(/^\w+([._-]\w+)*@(\w+\.)+\w+$/) ) { return false; } return true; }

关于JavaScript验证电子邮箱的函数,本文就介绍这么多,希望对您有所帮助,谢谢!

Statement:
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