阻止浏览器记住密码功能干扰表单填充
1.把input type=”password” 改成 input type=”text” 并在后面加上 οnfοcus=”this.type=’password’”
(这种在展示的时候密码会变成明文。。。)
2.在文档加载完成后将密码输入框设置为空
window.load = function(){
document.getElementById('ID').value='';
};
(没搞懂这样的做法)
3.在用户名和密码之间加上一个隐藏的文本框:
<input type="text" name="name">
<input type="hidden">
<input type="password" name="pass">
(我就用的这个,好用的一批~)
4.使用html5的属性:
<input type="text" name="name" autocomplete="off">
<input type="password" name="pass" autocomplete="off">
(试了,有的浏览器不好用)
来源:https://blog.csdn.net/playboyanta123/article/details/43795643
还没有评论,来说两句吧...