
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to use autocomplete attribute in HTML?
The autocomplete attribute is used with form element to set the autocomplete feature on or off. If the autocomplete feature is on, the browser will automatically show values, based on what users entered before in the field.
If the autocomplete feature is off, the browser won’t automatically show values, based on what users entered before in the field.
The following are the attribute values −
S. No | Attribute Value | Description |
---|---|---|
1 | on | This is the default value. Browser automatically complete values based on what users entered before. |
2 | off | Browser won’t complete values based on what users entered before. Users have to type the value. |
You can try to run the following code to learn how to use autocomplete attribute in HTML. To check running the below code, enter some values in the input type text and click Submit. After that fill the field again and run the code again, so that on typing a value in the field, you can see the autocomplete values. This is for autocomplete on value.
Example
For autocomplete off value, web browser won’t complete values based on what users entered before.
<!DOCTYPE html> <html> <head> <title> HTML autocomplete attribute</title> </head> <body> <form action = "" method = "get" autocomplete="on"> Details:<br><br> Student Name<br><input type = "name" name = "sname"><br> Training week<br><input type = "week" name = "week"><br> <input type = "submit" value = "Submit"> </form> </body> </html>
- Related Articles
- HTML autocomplete Attribute
- HTML autocomplete Attribute
- How to use formnovalidate attribute in HTML?
- How to use formaction attribute in HTML?
- How to use formenctype attribute in HTML?
- How to use formtarget attribute in HTML?
- How to use multiple attribute in HTML?
- How to use pattern attribute in HTML?
- How to use placeholder attribute in HTML?
- How to use step attribute in HTML?
- How to use href attribute in HTML Page?
- How to use a novalidate attribute in HTML?
- How to use the formmethod attribute in HTML?
- How to use the required attribute in HTML?
- How to use image height and width attribute in HTML Page?
