• 密码隐藏和显示


    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>prototype</title>
        <link rel="stylesheet" href="">
        <style type="text/css">
            .dd{margin-top:12px;margin-left:25px;}
        </style>
    </head>
    <body>
    <div class="container">
       <p> <label for="display"><b>账户兰大宝余额</b><i class="eye-open"></i> </label></p>
        <p><input type="text" id="display"/></p>
        <p><button><img src="images/lo_icon4.png" height="27" width="73" id="11"></button></p>
    </div>
     <script type="text/javascript">
            window.onload = function(){
    var img = document.querySelector('img');
                // var btn = document.querySelector('button');
                var input  = document.querySelector('#display');
                    img.onclick = function(e){
                        var text = e.target.src;
                        var fronttext = text.slice(0,-5);
                            var laterttext = text.slice(-4);
                        var three = fronttext+"3"+laterttext;
                         var four = fronttext+"4"+laterttext;
                            // console.log(fronttext+"[]"+laterttext);
                            // console.log("=========================================");
                            // console.log(four+"three");
                        if( text == four){
                            input.type  = 'password';
                            e.target.src = three;
                        }else if(text == three){
                            input.type ='text';
                            e.target.src = four;
                        }
                    }
            }
        </script>
     </body>
    </html>
  • 相关阅读:
    安装redis
    memcached复制-repcached
    memcached一致性哈希及php客户端实现
    安装php
    安装mysql
    安装apache
    putty配色方案
    virtualbox下centos实现主宿互访
    安装memcached
    linux网络、性能相关命令
  • 原文地址:https://www.cnblogs.com/lhl-shubiao/p/Js.html
Copyright © 2020-2023  润新知