<input type="text" name="email" id="email" onblur="ckemail"> <input type="button" value="check" onClick="ckemail()" /> <div id="ckemaildiv"></div> <script> function ckemail(email){ var reg =/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/; if(reg.test(email)){ $("#ckemaildiv").html("*邮箱合法"); }else{ $("#ckemaildiv").html("*邮箱不合法"); } } </script>