About
autocompletion in HTML will be find:
- in the HTML autocomplete attribute
- implemented in the datalist element
- or via a implementation/library
Attribute
The autocomplete attribute permits to fill forms with known or history data of the user such as:
- address
- postcode
- …
The autocomplete attribute can be set:
- on the form
- or on each control items
The autocomplete attribute describes the semantic of the value in order to auto-fill the form.
Example:
Your phone number: <input type=tel name=custtel autocomplete="billing tel">
Recipient's phone number: <input type=tel name=shiptel autocomplete="shipping tel">
Romanized name: <input name="e" type="text" autocomplete="section-en name">
Japanese name: <input name="j" type="text" autocomplete="section-jp name">
Credit card number:<input name="cc" type="text" inputmode="numeric" pattern="[0-9]{8,19}" autocomplete="cc-number">
See all possible value called autofill-field such as:
- off to turn it off
- email
- name
- honorific-prefix
- given-name
- additional-name
- family-name
- honorific-suffix
- nickname
- username
- new-password
- current-password
- one-time-code
- organization-title
- organization
- street-address
- address-line1
- address-line2
- address-line3
See all possible values at the specification