Input type=password, don't let browser remember the password

前端 未结 14 1497
孤城傲影
孤城傲影 2020-11-28 05:04

I remember seeing a way to have an such that the browser will not prompt the user to save the password. But I

14条回答
  •  不知归路
    2020-11-28 05:28

    seeing as autocomplete=off is deprecated, I suggest a more recent solution.

    Set your password field to a normal text field, and mask your input with "discs" using CSS. the code should look like this:

     
    
    input .myPassword{
        text-security:disc;
        -webkit-text-security:disc;
        -mox-text-security:disc;
    }
    

    Please note that this may not work propely on firefox browsers, and an additional walkaround is needed. Read more about it here :https://stackoverflow.com/a/49304708/5477548.

    The solution was taken from this link, but to comply with SO "no-hotlinks" i summarized it here.

提交回复
热议问题