密码输入框的显示/隐藏

admin 站长可乐 关注 运营团队 高级会员
发表于网络技能版块 代码
<li class="aui-list-item">
    <div class="aui-list-item-inner">
        <div class="aui-list-item-label">用户名</div>
        <div class="aui-list-item-input">
            <input type="text" placeholder="请输入用户名" id="username" name="username">
        </div>
        <div class="aui-list-item-input" style="width:15%;">
        </div>
    </div>
</li>
<li class="aui-list-item">
    <div class="aui-list-item-inner">
        <div class="aui-list-item-label">密&nbsp;&nbsp;&nbsp;码</div>
        <div class="aui-list-item-input">
            <input type="password" placeholder="请输入密码" id="password" name="password">
        </div>
        <div class="aui-list-item-input" style="width:15%;">
            <img src="./img/yy.gif" alt="显示密码" id="openEye">
            <img src="./img/eye_closed.png" alt="隐藏密码" id="closeEye" style="display:none;">
        </div>
    </div>
</li>
$("#openEye").click(function(){
    $("#password").attr("type","text");
    $("#openEye").hide();
    $("#closeEye").show();
});
$("#closeEye").click(function(){
    $("#password").attr("type","password");
    $("#closeEye").hide();
    $("#openEye").show();
});

湖北,孝感,云梦县

评论列表 评论
发布评论

评论: 密码输入框的显示/隐藏

拖动滑块验证
»
已有0次打赏