HTML <form>オートコンプリート属性
例
オートコンプリートがオンになっているフォーム:
<form action="/action_page.php" method="get" autocomplete="on">
<label for="fname">First name:</label>
<input type="text" id="fname"
name="fname"><br><br>
<label for="email">Email:</label>
<input type="text" id="email" name="email"><br><br>
<input
type="submit">
</form>
定義と使用法
このautocomplete
属性は、フォームのオートコンプリートをオンにするかオフにするかを指定します。
オートコンプリートがオンの場合、ブラウザはユーザーが以前に入力した値に基づいて値を自動的に完了します。
ヒント:フォームのオートコンプリートを「オン」にしたり、特定の入力フィールドを「オフ」にしたり、またはその逆を行うことができます。
ブラウザのサポート
表の数字は、属性を完全にサポートする最初のブラウザーバージョンを示しています。
Attribute | |||||
---|---|---|---|---|---|
autocomplete | Yes | Yes | 4.0 | 5.2 | 15.0 |
構文
<form autocomplete="on|off">
属性値
Value | Description |
---|---|
on | Default. The browser will automatically complete values based on values that the user has entered before |
off | The user must enter a value into each field for every use. The browser does not automatically complete entries |
❮HTML<form>タグ