Forms: Prevent Autofill

I have a simple log in form and I want to prevent the browser from remembering the password. It is fine to remember the username.

Is that possible?

I have tried autocomplete="off"

Depends on the browser but you should be able to use the autocomplete attribute:

autocomplete="off"

Note this isn’t a foolproof solution. Previous versions of chrome required autocomplete="chrome-off" instead, should now be fixed in latest versions. If that doesn’t work in your situation there a few other recommendations here:

Thanks @max_gb! Got it to work with:

autocomplete="new-password"

2 Likes