邮箱验证-JS正则表达式
2021-04-25 23:28
标签:function var val this round type put ack input 邮箱验证-JS正则表达式 标签:function var val this round type put ack input 原文地址:https://www.cnblogs.com/lsyy2017/p/12227143.htmlinput type="text" placeholder="请输入邮箱" id="email">
script>
email.onchange = function(){
var email = this.value;
var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
if(reg.test(email)){
alert("邮箱格式正确");
}else{
alert("邮箱格式不正确");
}
}
script>
html>
上一篇:Ajax(2)
下一篇:js逆向==>js2py