
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to specify whether the <form> or the <input> element should have autocomplete enabled in HTML?
Use the autocomplete attribute to enable autocomplete in an HTML form. The autocomplete attribute is used with form elements 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 the 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
You can try to run the following code to specify whether the <form> or <input> element should have to autocomplete enabled in HTML −
<!DOCTYPE html> <html> <head> <title>HTML textarea Tag</title> </head> <body> <form action = "/cgi-bin/hello_get.cgi" method = "get" autocomplete="on"> Full Name <br> <input type = "text" name = "fname"> <br> <input type = "submit" value = "submit" /> </form> </body> </html>
- Related Questions & Answers
- HTML <form> autocomplete Attribute
- HTML <input> autocomplete Attribute
- Style every enabled <input> element with CSS
- Should I use <img>, <object>, or <embed> for SVG files?
- How to specify that an <input> element should be pre-selected when the page loads in HTML?
- HTML <button> form Attribute
- HTML <form> target Attribute
- What is the correct way of using <br>, <br/>, or <br /> in HTML?
- How to create a valid HTML document with no <html><body> and <head> element?
- HTML <input> checked Attribute
- HTML <input> max Attribute
- HTML <input> placeholder Attribute
- HTML <input> required Attribute
- HTML <input> size Attribute
- HTML <input> width Attribute