标签:function var val this round type put ack input
<input 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>
标签:function var val this round type put ack input
原文地址:https://www.cnblogs.com/lsyy2017/p/12227143.html