<!DOCTYPE html>  
<html>  
    <head>  
        <meta charset="UTF-8">  
        <title></title>  
    </head>  
    <body>  
        <script>  
            function check() {  
                var email = document.getElementById("email");  
                if (email.value == "") {  
                    alert = ("请输入您的Email");  
                    return false;  
                } else if (!email.checkValidity()) {  
                    alert("账号错误,草啊");  
                    return false;  
                }  
            }  
        </script>  
        <form id="testfom" onsubmit="check()" novalidate="true">  
            <label form="email">Email</label>  
            <input name="email" type="email" "id="email "><br>  
            <input type="submit ">  
        </form>  
    </body>  
</html>
写完这个程序,跑不了是为什么?
            
            
            
            
1 个回复
BoredApe - 有问题就会有答案。
语法错误..
<input name="email" type="email" *"id="email"** ><br>