Demo entry 6786568

ad

   

Submitted by anonymous on Apr 01, 2019 at 04:24
Language: HTML. Code size: 2.5 kB.

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title>Mission-N Badminton Hall</title>
    <style>
        *{
            margin: 0;
            padding: 0; 
        }
        .father{
            width: 800px;
            height: 600px;
            margin: 0 auto;
            border: 0.5px solid #eee;
            border-top-left-radius:5px;
            border-bottom-left-radius:5px;
            /* box-sizing: border-box; */
        }
        .left{
            width: 200px;
            height: 600px;
            background-color: #2e3238;
            box-sizing: border-box;
            float: left;
            border-top-left-radius:5px;
            border-bottom-left-radius:5px;
        }
        #right{
            width: 600px;
            height: 440px;
            background-color: #eee;
            float: right;
            border-top-right-radius:5px;
            /* border-bottom-right-radius:5px; */
        }
        #submit{
            width: 600px;
            height: 160px;
            float: right;
            box-sizing: border-box;
            position: relative;
            border-bottom-right-radius:5px;
        }
        #btn{
            float: right;
            width: 100px;
            position: absolute;
            right: 0;
            bottom: 0;
        }
        input:-webkit-autofill{ box-shadow:0 0 0px 1000px #fff inset;}
    </style>
    <script src="js/jquery-1.12.4.min.js"></script>
</head>

<body>
    <div class="father">
        <div class="left">
            <img src="1.png" width="200px" alt="">
        </div>
        <div id="right">

        </div>
        <div id="submit" style="cursor: pointer;">
            <input placeholder="按Enter键发送" onkeydown="keyLogin();" type="text" name="test" style="border: 0px;outline:none;width: 580px;line-height: 15px;"></input>
            <button id="btn" style="display:none;">发送</button>
        </div>
    </div>
    <script>
        $("#btn").click(function () {
            var p = document.createElement('p');
            p.innerHTML = $("input[name='test']").val();
            var div = document.getElementById('right')
            div.appendChild(p);
            $("input[name='test']").val('');
        });
        function keyLogin() {
            if (event.keyCode == 13)  //回车键的键值为13
            $("#btn").click(); //调用登录按钮的登录事件
        }
    </script>
</body>

</html>

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).