HTML 表单中的字段是否有“标准”名称列表?例如,名字与全名、家庭电话等。如果没有官方 W3C 或其他列表,是否有适用于所有自动填充应用程序的列表?
HTML 表单中的字段是否有“标准”名称列表?
不,没有。
或者例如,名字与全名、家庭电话等。是否有适用于所有自动填充应用程序的列表?
您询问的是
autocomplete=""
元素上的 <input />
属性。 是的,HTML Living Standard 规范中有一个列表。
截至 2023 年 10 月,列表为:
"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"
"address-level4"
"address-level3"
"address-level2"
"address-level1"
"country"
"country-name"
"postal-code"
"cc-name"
"cc-given-name"
"cc-additional-name"
"cc-family-name"
"cc-number"
"cc-exp"
"cc-exp-month"
"cc-exp-year"
"cc-csc"
"cc-type"
"transaction-currency"
"transaction-amount"
"language"
"bday"
"bday-day"
"bday-month"
"bday-year"
"sex"
"url"
"photo"
此外,地址字段的
autocomplete
可以选择添加 billing
或 shipping
前缀。
对于
<input type="tel" />
,值 home
、work
、mobile
、fax
和 pager
。