问答详情
源自:1-2 如何开始及举例

为啥没反应啊

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" content="text/html">

<script src = "D:\mycode\jquery-3.2.1.js"></script>

<script src = "D:\mycode\jquery.validate-1.13.1.js"></script>

<link rel="stylesheet" type="text/css" href="css/validform.css">

<title>validation Demo</title>

</head>

<body>

<form id = "form1">

<fieldset>

<legend>用户登录</legend>

<p>

<LABEL for = "username">用户名</LABEL>

<input type="text" name="username" id="username">

</p>


<p>

<LABEL for = "password">密码</LABEL>

<input type="text" name="password" id="password">

</p>


<p>

<input type="submit" value="登录">

</p>

</fieldset>

</form>


<script type = "text/javascript">

$(document).ready(function(){

alter("sadd");

$("#form1").validate({

rules:{

username:{

required:true,

minilength:2,

maxlength:10

},

password:{

required:true,

minilength:2,

maxlength:10

}

}

});

});

</script>

</body>

</html>


提问者:调皮的魔法少女李狗蛋儿 2017-08-09 23:45

个回答

  • 调皮的魔法少女李狗蛋儿
    2017-08-10 22:59:01

    找到问题了,alter那句错了,删了就行了。

  • 地平望style
    2017-08-10 20:36:10

    <meta charset="utf-8" content="text/html">

    <script src = "D:\mycode\jquery-3.2.1.js"></script>

    <script src = "D:\mycode\jquery.validate-1.13.1.js"></script>

    <link rel="stylesheet" type="text/css" href="css/validform.css">

    这几行代码有错误