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

前端 未结 14 1451
孤城傲影
孤城傲影 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:35

    You can use JQuery, select the item by id:

    $("input#Password").attr("autocomplete","off");
    

    Or select the item by type:

    $("input[type='password']").attr("autocomplete","off");
    

    Or also:

    You can use pure Javascript:

    document.getElementById('Password').autocomplete = 'off';
    

提交回复
热议问题