how to make password textbox value visible when hover an icon

前端 未结 11 1301
误落风尘
误落风尘 2021-01-31 03:01

Good day all,

I have a form that has a password field:


Naturally, the i

11条回答
  •  忘了有多久
    2021-01-31 03:45

    As these guys said, just change input type.
    But do not forget to change type back as well.

    See my simple jquery demo: http://jsfiddle.net/kPJbU/1/

    HTML:

    
    
    icon

    jQuery:

    $('.icon').hover(function () {
        $('.password').attr('type', 'text');
    }, function () {
        $('.password').attr('type', 'password');
    });
    

提交回复
热议问题