登录密码,眼睛效果,点击显示,点击隐藏

$(document).ready(function(){
    $(".userinfo_main_csrq i").click(function(){

        if ($( this ).siblings("input").attr("type") == "text") {
            $( this ).siblings("input")[0].type = "password";  
            $( this ).removeClass("userinfo_main_csrq_i");   
        }else{
            $( this ).siblings("input")[0].type = "text"; 
            $( this ).addClass("userinfo_main_csrq_i");   
        }   
    });
});

<div class="userinfo_main_csrq"><span>原密码span><b>|b><input name="old_password" type="password" maxlength="25"><i>i>div>

你可能感兴趣的:(ThinkPHP)