html tutorial - autocomplete Attribute in HTML - html5 - html code - html form



Autocomplete attribute in html

Learn html - html tutorial - Autocomplete attribute in html - html examples - html programs

  • The autocomplete attribute is mused to enable autocomplete option for a form or an input file.
  • The autocomplete attribute allows the browser to predict the value.
  • Based on the earlier typed values. When the user starts to type in a field, the browser displays the options to fill in the field.

Syntax for autocomplete attribute in HTML:

<form autocomplete = “on | off”>

Differences between HTML 4.01 and HTML5 for autocomplete attribute:

HTML 4.01

  • HTML4 does not support autocomplete attribute.

HTML5

  • autocomplete attribute is new in HTML5.

Applies to:

Elements Attribute
<form> autocomplete
<input> autocomplete

autocomplete attribute value in HTML:

Value Description
on Specifies that autocomplete is on (enable)
off Specifies that autocomplete is off (disable)

Sample coding for autocomplete attribute in HTML:

Tryit<!DOCTYPE html>
<html>
    <body>
        <form action="auto.htm" method="get" autocomplete="on">
            First name: <input type="text" name="fname"><br>
            E-mail: <input type="email" name="email"><br>
            <input type="submit">
        </form>
    </body>
</html>

Code Explanation for autocomplete attribute in HTML:

autocomplete Attribute Code Explanation

  1. autocomplete attribute is used to enable the auto complete in the specified form.

Output for autocomplete attribute in HTML:

autocomplete Attribute Output

  1. When user type the “wi” the browser predict the value as” “wikitechy” which is user previously used.

Browser Support for autocomplete attribute in HTML:

17.0 5.0 4.0 5.2 9.6

Related Searches to autocomplete Attribute in html