YouTip LogoYouTip

Att Form Autocomplete

# HTML
autocomplete Attribute The `autocomplete` attribute of the `` tag specifies whether the form should have autocomplete (autofill) enabled or disabled. When autocomplete is enabled, the browser automatically predicts and suggests values for input fields based on what the user has entered previously. When a user starts typing in a field, a dropdown list of previously entered values appears as options. --- ## Browser Support The numbers in the table below indicate the first browser version that fully supports the `autocomplete` attribute. | Attribute | Chrome | Edge / IE | Firefox | Safari | Opera | | :--- | :--- | :--- | :--- | :--- | :--- | | **autocomplete** | Yes | Yes | 4.0 | 5.2 | 15.0 | --- ## Syntax ```html ``` ### Attribute Values | Value | Description | | :--- | :--- | | **on** | **Default.** Enables autocomplete. The browser will automatically suggest values based on the user's history. | | **off** | Disables autocomplete. The user must manually enter a value into each field for every visit; the browser will not suggest previous entries. | --- ## Code Examples ### Example 1: Form with Autocomplete Enabled (Default) In this example, the form has autocomplete turned on. The browser will suggest previously entered values for both the name and email fields. ```html



``` ### Example 2: Form with Autocomplete Disabled If you want to prevent the browser from caching and suggesting sensitive information, you can turn autocomplete off. ```html




``` --- ## Key Considerations & Best Practices ### 1. Form-level vs. Input-level Autocomplete The `autocomplete` attribute can be set on the `
` element as a whole, or on individual `` elements. * Setting `autocomplete="off"` on the `` disables autocomplete for all inputs within that form. * You can override the form's setting on specific inputs. For example, you can enable autocomplete on the form, but disable it for a specific sensitive field: ```html
``` ### 2. Modern Browser Behavior and Passwords Modern web browsers (such as Chrome, Firefox, and Safari) often ignore `autocomplete="off"` on login forms to encourage the use of built-in password managers. If a browser detects a login or password field, it may still offer to autofill or save the credentials even if `autocomplete="off"` is specified. ### 3. HTML5 vs. HTML 4.01 The `autocomplete` attribute is a standard feature introduced in **HTML5**. It was not part of the official HTML 4.01 specification, although many browsers supported it informally prior to HTML5.
← Att Frameset ColsAtt Form Action β†’