函数
function checkEmail(email){if(email == null || email == ""){return true;}email = email.trim();if(email == ""){return true;}var patt1 = /^[a-z,A-Z,0-9]+@[a-z,A-Z]+.[a-z,A-Z]+$/if(str.match(patt1) == null){return false;}return true;}
调用:
if(checkEmail("5588888@")){alert('格式正确');}if(!checkEmail("5588888@outlokk.889")){alert('格式错误');}