入力URLオートコンプリートプロパティ
例
URLフィールドのオートコンプリートをオフに設定します。
document.getElementById("myURL").autocomplete = "off";
定義と使用法
autocompleteプロパティは、URLフィールドのautocomplete属性の値を設定または返します。
オートコンプリートがオンの場合、ブラウザはユーザーが以前に入力した値に基づいて値を自動的に完了します。
ヒント:一部のブラウザでは、これを機能させるためにオートコンプリート機能をアクティブにする必要がある場合があります(ブラウザのメニューの[設定]の下を見てください)。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
autocomplete | Yes | 10.0 | Yes | Not supported | Yes |
構文
オートコンプリートプロパティを返します。
urlObject.autocomplete
オートコンプリートプロパティを設定します。
urlObject.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 URL field for every use. The browser does not automatically complete entries |
技術的な詳細
戻り値: | オートコンプリートの状態を表す文字列 |
---|
その他の例
例
オートコンプリートの状態を返します。
var x = document.getElementById("myURL").autocomplete;
関連ページ
HTMLリファレンス:HTML <input>オートコンプリート属性
❮入力URLオブジェクト