1. 程式人生 > >如何處理由於瀏覽器設定導致的autocomplete="off"失效的問題

如何處理由於瀏覽器設定導致的autocomplete="off"失效的問題

1.因為谷歌只會自動填充第一個<input type="password">和它之前的<input>,所以可以新增以下程式碼:

<input style="display:none"><input type="password" style="display:none">//新增在form元素的最上邊,

2.最好的解決是給autocomplete設定其他值(除on或off)

<input type="text" name="email">
<input type="password" name="password" autocomplete="new-password"
>