谷歌浏览器input自动填充问题

1.不允许密码自动填充

<input type="text"  autocompleted="off" />
<input type="password"  autocompleted="new-password" />
<input type="password"  autocompleted="new-password" style="display:none"/>

 

2.不允许用户名自动填充,但是获取焦点能获取历史账号信息。

若只有用户名没有密码,写一个密码框设置为隐藏格式

<input type="text" readonly />

$("#userId").mouseenter(()=>{
    $("#userId").removeAttr("readonly");
});

 

posted @ 2021-03-10 09:41  念初~逝水  阅读(162)  评论(0)    收藏  举报