当浏览器记住密码后,在系统中点击添加是,页面中有用户名和密码项会自动带入保存的账号信息: 最有效的方法:
1、<input type="password" placeholder="密码" readonly οnfοcus="this.removeAttribute('readonly');"/>
2、type="text"与type="password"的<input/>标签紧邻时触发自动填充行为,则将两个<input/>隔开,使用隐藏的方式“欺骗”浏览器,将密码信息填写在隐藏区域。
.is-hidden {
position: absolute;
left: -10000px;
top: -10000px;
}
/*让input看不见,而不是直接display: none,如果直接display: none,有些浏览器则不生效,比如谷歌*/
<input type="text" class="is-hidden" />
<input type="password" class="is-hidden" />