chrome浏览器选择记住密码后,如何避免对所有input标签进行自动填充?

如题题题题题题题题题题题题题题题题题题题题题题题

回复
阅读 34.4k
10 个回答

在不支持html5的环境下,可以在不想对其自动填充的input元素之上再添加一个displaynoneinput元素

autocomplete = 'new-password'

给你个简单的建议:开启隐身模式

html5表单空间的新的属性(autocomplete):
<input type="email" name="email" autocomplete="off" />

给不需要记录的input加autocomplete="off"

<input type="password" name="password" autocomplete="off">

设置为type=“text”,获取焦点的时候再改为type=“password”

<input type="text" class="demo" id="demo" placeholder="请输入密码" autocomplete="off" onfocus="this.type='password'"> 

chrome 62版本,已经没有用了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏