DEV Community

Cover image for HTML autocomplete "one-time-code".
Maciej Trzciński 🌱🇵🇱
Maciej Trzciński 🌱🇵🇱

Posted on

HTML autocomplete "one-time-code".

Using only html autocomplete (autocomplete="one-time-code") you can autofill inputs using security codes sent by SMS providers.



<input
  type="text"
  name="auth-token"
  inputmode="numeric"
  pattern="[0-9]*"
  autocomplete="one-time-code"
/>


Enter fullscreen mode Exit fullscreen mode

Security code


If you like this article, follow me on Twitter @MaciejDEV

Top comments (2)

Collapse
 
gusevdv profile image
Dmitry Gusev • Edited

Hello! I've added the autocomplete="one-time-code" to my input and my Chrome for Android browser suggests my previous OTP code.
Is "one-time-code" is supported only on iOS, isn't it?
Should I use autocomplete="off" everywhere besides iOS?

Collapse
 
maciejtrzcinski profile image
Maciej Trzciński 🌱🇵🇱

👋, to my knowledge it is implemented only on iOS and Mac.