Home >Web Front-end >JS Tutorial >JavaScript function to verify email address_javascript skills

JavaScript function to verify email address_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:38:521689browse

This article introduces a JavaScript function to verify email addresses, which is quite reliable.

JavaScript function to verify email address, the source code is as follows:

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

About the JavaScript email verification function, this article will introduce you so much. I hope it will be helpful to you, thank you!

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