密码小眼睛

 $(".yan").click(function(){
        console.log($(this).parent().parent().siblings().children("input").attr("type"))
        if ($(this).parent().parent().siblings().children("input").attr("type") == "text") {
            $(this).parent().parent().siblings().children("input")[0].type = "password";
            $( this ).attr("src","images/yan2.png");
        }else{
            $(this).parent().parent().siblings().children("input")[0].type = "text";
            $( this ).attr("src","images/yan.png");
        }
    });

 

posted @ 2019-07-11 09:06  2人4人  阅读(247)  评论(0编辑  收藏  举报