fxxqq / 6fedcom.github.io

frank的前端养成记(hexo博客)
https://6fed.com
22 stars 5 forks source link

chorme怎么禁止自动填充浏览器记住的密码? #8

Open fxxqq opened 6 years ago

fxxqq commented 6 years ago

谷歌浏览器记住密码后第二次登录总是会填充密码,用户体验很不好,而且黄色背景还会影响样式。

解决方案如下:

<input type="password" name="txtPassword" style="display:none"> 
<input type="password" name="txtPassword"  placeholder="请输入密码" autocomplete="off"  />

谷歌浏览器比较吊,只加上一个隐藏密码框还是不行的,把两个密码框名字改成一样的就好了,这家伙就找不到了,(^__^) 嘻嘻……