HTML <input> autocomplete eigenschap
Definitie en gebruik
autocomplete
Deze eigenschap specificeert of het invoerveld automatische invulling moet inschakelen.
Automatische invulling laat de browser waarden voorspellen. Wanneer de gebruiker begint met typen in het veld, moet de browser opties weergeven die overeenkomen met eerdere ingevoerde waarden om het veld in te vullen.
Opmerking:autocomplete
Deze eigenschap is van toepassing op de volgende invoertypen:
- tekst
- zoek
- url
- tel
- wachtwoord
- datumkiezers
- bereik
- kleur
Voorbeeld
Een HTML-formulier met automatische invulling, inclusief een veld zonder automatische invulling:
<form action="/action_page.php" autocomplete="on"> <label for="fname">Achternaam:</label> <input type="text" id="fname" name="fname"><br><br> <label for="lname">Voornaam:</label> <input type="text" id="lname" name="lname"><br><br> <label for="email">Email:</label> <input type="email" id="email" name="email" autocomplete="off"><br><br> <input type="submit"> </form>
Syntax
<input autocomplete="on|off">
Attribute value
Value | Description |
---|---|
on | Default. Specifies that auto-complete is turned on (enabled). |
off | Specifies that auto-complete is turned off (disabled). |
Browser support
The numbers in the table indicate the first browser version that fully supports this property.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
17.0 | 6.0 | 2.0 | 5.1 | 10.0 |
Tip:In some browsers, you may need to manually enable the auto-complete feature (please see the 'Preferences' menu in the browser menu).
Note:autocomplete
Properties are new properties in HTML5.