English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML reference manual

Complete list of HTML tags

HTML: <input> autocomplete attribute

The autocomplete attribute specifies whether the auto-complete feature of the input field should be enabled. The auto-complete feature allows the browser to predict values. When the user starts typing in the field, the browser should display options for filling in the field based on the earlier entered values.

 HTML <input> etichetta

Online example

HTML form with auto-complete feature turned on (and off in an input field):

<!DOCTYPE html>
<html>
<head>
<title>HTML:<input> autocomplete attribute - Basic Tutorial Website (oldtoolbag.com)</title>
<body>
<form action="action_page.php" autocomplete="on">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  E-mail: <input type="email" name="email" autocomplete="off"><br>
  <input type="submit">
</form>
</body>
</html>
Test to see ‹/›
Fill in and submit the form, then reload the page to view how the auto-complete works.
Please note that the auto-complete function of the form is 'on', while the auto-complete function of the email field is 'off'.

Browser compatibility

IEFirefoxOperaChromeSafari

Tutti i browser mainstream supportano l'attributo autocomplete.

Suggerimento:In alcuni browser, potrebbe essere necessario attivare la funzione di completamento automatico per che funzioni (consultare le opzioni del menu del browser).

Definizione e uso

L'attributo autocomplete specifica se la funzione di completamento automatico del campo di input dovrebbe essere abilitata.

La funzione di completamento automatico permette al browser di prevedere i valori. Quando l'utente inizia a digitare nel campo, il browser dovrebbe mostrare le opzioni per riempire il campo in base ai valori precedentemente digitati.

Attenzione:L'attributo autocomplete è applicabile ai seguenti tipi di <input>: text, search, url, tel, email, password, datepickers, range e color.

Differenze tra HTML 4.01 e HTML5

L'attributo autocomplete è una nuova proprietà dell'HTML5.

Sintassi

<input autocomplete="on|off">

Valore dell'attributo

ValoreDescrizione
onPredefinito. Definire la funzione di completamento automatico attivata.
offDefinire la funzione di completamento automatico disattivata.
 HTML <input> etichetta