~~~ /* * 检验邮箱 */ var checkEmail = function(emailStr){ var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/; if(!reg.test(emailStr)){ return false; } return true; } ~~~