change type of input field with jQuery

后端 未结 29 2606
青春惊慌失措
青春惊慌失措 2020-11-22 05:13
$(document).ready(function() {
    // #login-box password field
    $(\'#password\').attr(\'type\', \'text\');
    $(\'#passwo         


        
29条回答
  •  滥情空心
    2020-11-22 05:54

    I guess you could use a background-image that contains the word "password" and change it back to an empty background-image on .focus().

    .blur() ----> image with "password"

    .focus() -----> image with no "password"

    You could also do it with some CSS and jQuery. Have a text field show up exactly on top of the password field, hide() is on focus() and focus on the password field...

提交回复
热议问题