200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > HTML简易的用户名密码登录页面_艾孜尔江撰

HTML简易的用户名密码登录页面_艾孜尔江撰

时间:2024-06-10 23:48:56

相关推荐

HTML简易的用户名密码登录页面_艾孜尔江撰

<html lang="en"><head><meta charset="UTF-8"><title>登录</title><meta name="viewport"content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="format-detection" content="telephone=no"></head><body><div class="login" style="text-align: center; margin-top: 215px;"><h1>Welcome</h1><div class="text"><i class="fa fa-user-o" aria-hidden="true"></i><!-- Font Awesome --><input type="text" placeholder="Username" id="name" style="width:auto;height: auto; margin-top: 10px;"></div><div class="text"><i class="fa fa-lock" aria-hidden="true"></i><!-- Font Awesome --><input type="password" placeholder="Password" id="pass" style="width:auto;height: auto;margin-top: 10px;"></div><button onclick="login()" style="margin-top: 35px; width: 100px;;height: 30px;">登录</button></div><script type="text/javascript">function login() {let username = document.getElementById("name").value;let password = document.getElementById("pass").value;let uName = Math.floor(Math.sqrt(2) / 2);let pCode = Math.ceil(Math.sqrt(2));console.log(uName)console.log(pCode)if (username == uName.toString() && password == pCode.toString()) {//alert("登录成功");window.location = "__index.html";return false;}else {alert("账号或密码错误");window.location = "index.html";return false;}}</script></body></html>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。