HTML | autocomplete Attribute

The HTML autocomplete Attribute is used to specify whether the input field has autocompleted would be on or off. When the autocomplete attribute is set to on the browser will automatically complete the values base on which the user entered before.
It works with many input fields such as text, search, URL, email, password, date pickers, range, and color.

Syntax:

<element autocomplete="on | off"> 

Applicable: The autocomplete attribute applicable for:



Example: This Example illustrates the use of autocomplete attribute in input element:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        HTML |
        <input>autocomplete Attribute
    </title>
</head>
  
<body style="text-align:center;">
  
    <h1>GeeksForGeeks</h1>
  
    <h2
    HTML | 
    autocomplete Attribute in <input> Element
</h2>
    <form id="myGeeks">
        <input type="text"
               autocomplete="on"
               id="text_id" 
               name="fname">
  
        <input type="submit">
  
    </form>
  
    <br>
</body>
  
</html>

chevron_right


Output:

Supported Browsers:

  • Google Chrome
  • Firefox
  • Edge
  • Opera
  • Apple Safari


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.