zoukankan      html  css  js  c++  java
  • 晚上学习———登录框 有用户名和密码输入框默认字问题

     1 <!DOCTYPE html>
     2 <html lang="zh-cn">
     3 <head>
     4     <meta charset="utf-8">
     5     <title>标准化页面格式</title>
     6     <style type="text/css">
     7         #login{
     8             width:300px;
     9             height: 250px;
    10             background: gray;
    11             margin: 0 auto;
    12             padding-top: 30px;
    13             font-size: 16px;
    14             text-align: center;
    15         }
    16         #username,#password{
    17             width:150px;
    18             height: 20px;
    19         }
    20         #Login,#rset{
    21             width:90px;
    22             height: 40px;
    23             margin-left: 20px;
    24         }
    25         a{
    26             float: right;
    27         }
    28     </style>
    29     <link rel="stylesheet" type="text/css" href="">
    30 </head>
    31 <body>
    32     <form id="login" action="#" method="get">
    33         username:<input type="text" value="请输入账号" id="username"><br /><br />
    34         password:<input type="password" value="88888888" id="password"><br /><br />
    35                 <input type="submit" value="登录"    id="Login" />
    36                 <input type="reset" value="重置" id="rset" /><br /><br />
    37                 <a href="#">忘记密码</a>
    38     </form>
    39     <script src="js/jquery.js"></script>
    40     <script>
    41         $(document).ready(function(){
    42             $("#username").focusin(function(){
    43                 $("#username").val("")
    44             })
    45             .focusout(function(){
    46                 if($("#username").val()=="")
    47                     {
    48                         $("#username").val("请输入账号");
    49                     }
    50             })
    51         })
    52     </script>
    53 </body>
    54 </html>

    样式有点丑,基本功能实现了

  • 相关阅读:
    已经连接到空闲例程的解决方法
    SQLplus命令中导出数据
    Oracle设置时间格式
    Oracle热备份
    多元化控制文件
    ORA28000: the account is locked
    Windows 7 如何删除 Windows.old 文件夹
    Linux常用命令之文件命令
    Linux 常用命令之进程管理
    Python中的apply,filter和map函数
  • 原文地址:https://www.cnblogs.com/webzhang/p/4996270.html
Copyright © 2011-2022 走看看