Working With AutoComplete Attribute In HTML5

INTRODUCTION

In this blog, I will explain the Autocomplete HTML input attribute.

HTML input attributes

Attributes mean a single atomic unit of an entity.

  1. The value attribute --> specifies the value of the input.
  2. The readonly attribute --> the input values which cannot be changed but we can read.
  3. The disabled attribute --> the value cannot be used in the forms.
  4. The size attribute --> specifies the size of the characters.
  5. The maxlength attribute --> depends upon the length of inputs.

HTML Autocomplete attributes

The Autocomplete attribute is used to provide the options at an input field so that the text in the field can be filled automatically. 

SYNTAX

<input autocomplete="on|off">

  1. <!DOCTYPE html>  
  2. <html>  
  3. <body><title> autocomplete</title>      
  4. <form action="/blogs.php" autocomplete="on">  
  5. Name:<input type="text" name="name1"><br>  
  6. Department:<input type="text" name="name2"><br>  
  7. E-mail:<input type="email" name="email" autocomplete="off"><br>  
  8. <input type="submit">  
  9. </form>  
  10. </body>  
  11. </html>  
ATTRIBUTES VALUE DESCRIPTION
Autocomplete On or Off Check whether the autocomplete option is enabled or not, in the input elements.
 
 
 
The compiled page looks like below. 
 
 
 
OUTPUT
 
X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now