Languages
[Edit]
EN

HTML - disable input autocomplete

0 points
Created by:
Palpys
464

In this article, we would like to show you how to disable input element autocomplete in HTML.

Quick solution:

<input type="text" autocomplete="off" />

 

Practical example

In this example, we use the input element's autocomplete="off" attribute to disable the input autocomplete.

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<body>
  <form>
    <label>
      <span>Field 1:</span>
      <input type="text" name="field-1" autocomplete="off" />
    </label>
    <br />
    <label>
      <span>Field 2:</span>
      <input type="text" name="field-2" autocomplete="off" />
    </label>
  </form>
</body>
</html>

Note:

You can also turn disable autocomplete for the whole form element:

<form autocomplete="off"></form>

References

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join