- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Autocomplete text input for HTML5?
Use the autocomplete attribute for autocomplete text input. The autocomplete attribute is used with a 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. The browser automatically complete values based on what users entered before. |
2 | off | The 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.
For autocomplete off value, the web browser will not 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 DOM Input Text autocomplete Property
- HTML DOM Input Email autocomplete Property
- HTML DOM Input URL autocomplete Property
- HTML DOM Input Search autocomplete Property
- How to disable autocomplete of an HTML input field?
- HTML5 Canvas Text Stroke for Large Font Size
- Listing down various options for input values in HTML5
- HTML5 input type range for vertical orientation possible in Firefox?
- How to set focus on a text input in a list with AngularJS and HTML5
- HTML5 Canvas Circle Text
- Input type URL in HTML5
- HTML5 Input type “number” in Firefox
- Using CSS :placeholder-shown to Customize Styles for Empty Text Input
- Remember and Repopulate File Input in HTML5
- HTML5 Input type=number removes leading zero
