現在許多瀏覽器都會忽略對用戶名密碼的 autocomplete="off"。

autocomplete 本來是瀏覽器私自實現的功能(雖然已幾乎成必備了),所以其行爲也沒有標準規範。

因此,就目前爲止,只要避免瀏覽器將表單識別爲含有用戶名密碼的表單即可。

在 password 之前加一個隱藏的 type="password" 即可。

<form>
    <input name="a" autocomplete="off">
    <input type="password" style="display:none">
    <input type="password" name="b"><button>Sign in</button>
</form>

相关文章:

  • 2022-12-23
  • 2021-05-14
  • 2022-12-23
  • 2021-05-04
  • 2021-06-09
  • 2022-01-22
  • 2022-02-11
猜你喜欢
  • 2022-12-23
  • 2021-05-18
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
相关资源
相似解决方案