zoukankan      html  css  js  c++  java
  • 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="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="auto;height: auto;margin-top: 10px;">
            </div>
            <button onclick="login()" style="margin-top: 35px;  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>
    
  • 相关阅读:
    JS使用 popstate 事件监听物理返回键
    JQ判断div是否隐藏
    SQL Server DATEDIFF() 函数
    取消a或input标签聚焦后出现虚线框
    C#定时任务
    C# 保留N位小数
    C#打印单据
    SQL语句创建函数
    SVN检出新项目
    解决jQuery的toggle()的自动触发问题
  • 原文地址:https://www.cnblogs.com/ezhar/p/15115472.html
Copyright © 2011-2022 走看看