<head> <title>Title</title> </head> <body> <input name="name" type="text" id="name"><br/> <input name="password" type="password" id="password"><br/> <button type="button" id="login">登录</button> </body> </html> <script type="text/javascript"> /*给登录按钮添加点击事件*/ $("#login").click(function () { /*获取输入框密码的值*/ var password = $("#password").val(); /*判断密码是否合规*/ if(password.length>=6&&password.length<=12){ window.location.href='你的页面路劲'; }else { alert("注册失败"); } }) </script>
87,993
社区成员
224,694
社区内容
加载中
试试用AI创作助手写篇文章吧