HTML <input> autocomplete Attribute

Last Updated : 31 Jul, 2026

The autocomplete attribute is used to enable or disable automatic suggestions in input fields based on previously entered values. It helps users fill forms faster and more easily.

  • Allows browsers to remember and suggest previously entered input values.
  • Can be set to on or off depending on whether autocomplete is needed.
  • Improves user experience by reducing typing effort in forms.

Syntax

<input autocomplete="on|off">

Attribute Values:

  • on: It has a default value. It specifies that autocomplete is enabled.
  • off: It specifies that the autocomplete is disabled.

Example: Illustrates the use of autocomplete attribute in <input> element. 

html
<!--Driver Code Starts-->
<!DOCTYPE html>
<html>

<head>
    <title>
        HTML | input autocomplete Attribute
    </title>
</head>

<body style="text-align:center;">

    <h1>GeeksForGeeks</h1>
    <h2>
        HTML | input autocomplete Attribute
    </h2>
<!--Driver Code Ends-->

    <form id="myGeeks">
        <input type="text" 
               id="text_id" 
               name="geeks" 
               autocomplete="on">
               
        <input type="submit">
    </form>

<!--Driver Code Starts-->
    <br>
</body>

</html>
<!--Driver Code Ends-->
Comment