Use autocomplete=new-password for new password fields
If a password field is for creating or changing a password, describe it with autocomplete="new-password":
<input type="password" autocomplete="new-password">
This tells the browser not to fill the person’s current password into the field. It may also offer to generate a secure one.
Treat autocomplete as a hint rather than an absolute block: password managers and browsers can make their own decisions. For a sign-in form, use autocomplete="current-password" instead.
Enjoyed reading this?
If you found this article helpful, consider supporting my writing. Every little bit helps keep this blog going.
Related articles
- Better Line Breaks With CSS balance and pretty
Use text-wrap balance for short headings and text-wrap pretty selectively for longer copy without hard-coded line breaks.
- Why 100vh Doesn’t Always Fit a Mobile Screen
Choose svh, lvh, dvh, or a flexible min-height when mobile browser controls make 100vh an awkward fit.
- Making Links Easy to Recognize
Make links recognisable with underlines, clear focus states, useful text, and behaviour that does not surprise the reader.