<!DOCTYPE html><html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jQuery动画特效</title> <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no"> </head> <body> <form id="demoForm"> <fieldset> <legend>用户登录</legend> <p> <label for="username">用户名</label> <input type="text" id="username" name="username" /> </p> <p> <label for="password">密码 </label> <input type="num" id="password" name="password" /> </p> <p> <input type="submit" name="" id="" value="登录" /> </p> </fieldset> </form> </body> <script type="text/javascript" src="jquery-1.12.0.min.js" ></script> <script src="jquery-validation-1.14.0/dist/jquery.validate.js"></script> <script> $(document).ready(function(){ $("#demoForm").validate({ rules:{ username:{ require:true, minlength:2, maxlength:10 }, password:{ require:true, minlength:2, maxlength:16 } } }); }); </script></html>
1 回答
- 1 回答
- 0 关注
- 1245 浏览
添加回答
举报
0/150
提交
取消