为啥没反应啊

来源:1-2 如何开始及举例

调皮的魔法少女李狗蛋儿

2017-08-09 23:45

<!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>


写回答 关注

2回答

  • 调皮的魔法少女李狗蛋儿
    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">

    这几行代码有错误

jQuery插件——Validation Plugin

validation让客户端表单验证变容易,缩短用户等待时间

65871 学习 · 216 问题

查看课程

相似问题