JavaScript validates E mail functions

  • 2020-03-30 03:47:03
  • OfStack

This article introduces a JavaScript function that validates E-mail boxes.

JavaScript validation email function, 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;
}


Related articles: