版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jx_zls/article/details/89413966
屏蔽自动填充
如果在浏览器记住密码的情况下,在进入注册页面等表单的页面是,浏览器会自动进行用户名和密码的填充,解决方案可以尝试以下方法:
-
autocomplete = 'off' / 'new-password'
使用
off
值有些浏览器会出现不兼容,可以使用new-password
来代替 -
在发生自动填充的页面(非登录页面)添加隐藏的输入框
<input type="text" name="username" style="display: none;" disabled autocomplete = "off"/>
<input type="password" name="password" style="display: none;" disabled autocomplete = "off"/>