if(email=""||(email.indexOf('@ '==-1)||(email.indexOf('.')==-1)){
代码错误,修改为下面的就好了
if(email=""||(email.indexOf('@ '==-1))||(email.indexOf('.')==-1)){
<html><head>引用JQ</head>
<body>
<form action="" onsubmit="return check()">
<input type="text" name="name" id="name>
<input type="password" name="pwd" id="pwd">
</form>
</body>
<script>
function check(){
var name = $("#name").val()
var pwd = $("#pwd").val()
if(!name || !pwd ){
alert("提示信息")
return false
}
}
</script>
</html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)