Vue,Js禁止自动填充浏览器记住的密码?

缺乏、安全感 2022-12-13 04:35 471阅读 0赞

https://www.zhihu.com/question/23529765

综合以上答案 可以这样写,但是我也只是测试了chrome与firefox,可行的

  1. 用户名:<input type="text" autocomplete="new-accounts">
  2. 密码:<input type="text" autocomplete="new-password" readonly onfocus="this.removeAttribute('readonly');this.type='password'" onblur="this.setAttribute('readonly',true);">

chrome的实现方案:

  1. <input type="password" autocomplete="new-password" name="pwd" placeholder="密码" readonly onfocus="this.removeAttribute('readonly');this.type='password'"/>

发表评论

表情:
评论列表 (有 0 条评论,471人围观)

还没有评论,来说两句吧...

相关阅读