1

I got a trouble when I use input tag type password. I stored my password before and every time I focus on password field browser recommend old username and password like under picture.

enter image description here

is any way to prevent it using javascript? I know how to turn off it by go to setting of browser but I want to turn off it using javascript because I am not sure if the client has turned that off with setting.

Alon Eitan
  • 11,997
  • 8
  • 49
  • 58
  • 4
    Try with autocomplete="off" prop – David Feb 27 '20 at 16:58
  • Does this answer your question? [How do you disable browser Autocomplete on web form field / input tag?](https://stackoverflow.com/questions/2530/how-do-you-disable-browser-autocomplete-on-web-form-field-input-tag) – Alon Eitan Feb 27 '20 at 16:58
  • I tried but autocomplete="off" doesn't work in new version chrome. Can u click my photo when i focus on password field browser suggest my both username and password :(( – hiep nguyenduc Feb 27 '20 at 17:02
  • So try `autocomplete="fsdkfj"` (Or any other random attribute value - It works for me) – Alon Eitan Feb 27 '20 at 17:06
  • Almost autocomplete just work in type text but my field password still suggest to me even though I tried set type attribute from password to text, it's still suggest :(( – hiep nguyenduc Feb 27 '20 at 17:13
  • 1
    don't, modern browsers do not support autocomplete="off" for login fields https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion – lalo Feb 27 '20 at 17:19

0 Answers0