防止浏览器记住密码,登录后对所有input禁止填充账户密码的方法

2019-08-28  本文已影响0人  Bior

1.忽悠浏览器。

<input type="text" style="display: none;" name="xx">

<input type="password" style="display: none;" name="xx">

2.把input type=”password” 改成 input type=”text” 并在后面加上 onfocus=”this.type=’password'”

3.在文档加载完成后将密码及用户输入框设置为空

4.使用html5的属性 (<input type="password" name="pass" autocomplete="off">)但是这种方案不兼容某些Chrome、Firefox;

上一篇 下一篇

猜你喜欢

热点阅读