大神们帮我看看代码的问题吧
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css" media="screen">
form{width:300px;}
</style>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>biaodan</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
</head>
<body>
<form id="demoForm">
<fieldset> 用户登陆
<p>
<label for="username">用户名:</label>
<input type="text" value="" id="username" name="username">
</p>
<p>
<label for="password">密码:</label>
<input type="password" value="" id="password" name="password" >
</p>
<label for="cpassword">确认密码:</label>
<input type="password" value="" id="cpassword" name="cpassword" >
</p>
<p><input type="submit" value="登陆"></p>
</fieldset>
</form>
<script src="http://cdn.bootcss.com/jquery/2.2.3/jquery.min.js"></script>
<script>
$(document).ready(function (){
$("#demoForm").validate({
rules:{
username:{
required:true,
maxlength:10,
minlength:2,
},
password:{
required:true,
maxlength:10,
minlength:2
},
cpassword:{
equalTo:"#password",
}
},
messages:{
username:{
required:"必须填写用户名",
maxlength:"用户名最大为10位",
minlength:"用户名最小为2位",
},
password:{
required:"必须填写用密码",
maxlength:"密码最大为10位",
minlength:"密码最小为2位"
}
cpassword:{
equalTo:"两次输入的密码不一致",
}
}
});
});
</script>
</body>
</html>