<div class="modal-body"> <form action="" class="form center-block" onsubmit="login()"> <div class="form-group"> <input type="text" id="username" class="form-control input-lg" placeholder="请输入用户名"> </div> <div class="form-group"> <input type="password" id="password" class="form-control input-lg" placeholder="请输入密码"> </div> <div class="form-group"> <button class="btn btn-primary btn-lg btn-block" type="submit">登录</button> </div> </form> </div> <script type="text/javascript"> function login() { var un = document.getElementById("username").value; var pw = document.getElementById("password").value; if (un == "admin" && pw == "admin") { window.open("TXL.html", '_blank'); this.window.close(); return true; } else { alert("登录失败"); return false; } } </script>
Caballarii