html之页面登录

<!DOCTYPE html>
<!-- saved from url=(0038)http://v3.bootcss.com/examples/signin/ -->
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="http://v3.bootcss.com/favicon.ico">

    <title>登录页面</title>

    <!-- Bootstrap core CSS -->
    <link href="./Signin_files/bootstrap.min.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="./Signin_files/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="./Signin_files/signin.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]>
    <script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="./Signin_files/ie-emulation-modes-warning.js."></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .form-signin-heading {
            text-align: center;
        }

        .email-input {
            margin-bottom: 15px !important;
        }

        .email-input, .password-input {
            border-radius: 3px !important;
        }

    </style>
    <script src="jquery-3.2.1.min.js"></script>
    <script>
        $(function () {
            $('[type="submit"]').click(function () {
                $('.comment-input').each(function () {
                    //如果第一个为空,则return false 终止循环
                    if ($(this).val().length === 0) {
                        $(this).parent().addClass('has-error');
                        $(this).next().removeClass('hide');
                        return false

                    } else {
                        $(this).parent().removeClass('has-error');
                        $(this).next().addClass('hide');
                    }
                });
                return false
            });
        })
    </script>
</head>

<body>

<div class="container">

    <form class="form-signin" novalidate>

        <h2 class="form-signin-heading">请登录</h2>

        <div class="form-group">
            <label for="inputEmail" class="sr-only">邮箱</label>
            <input type="email" id="inputEmail" class="form-control email-input comment-input" placeholder="请输入邮箱地址"
                   autofocus="">
            <span id="emailHelpBlock" class="help-block hide">请输入正确的邮箱地址</span>
        </div>


        <div class="form-group">
            <label for="inputPassword" class="sr-only">密码</label>
            <input type="password" id="inputPassword" class="form-control password-input comment-input"
                   placeholder="请输入登录密码">
            <span id="pwdHelpBlock" class="help-block hide">请输入6-12位密码</span>
        </div>

        <div class="checkbox">
            <label>
                <input type="checkbox" value="remember-me">记住密码
            </label>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
    </form>


</div> <!-- /container -->


<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="./Signin_files/ie10-viewport-bug-workaround.js."></script>


</body>
</html>

效果图:

login

以上用jQuery添加了校验

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值