Masukkan Properti pelengkapan otomatis Pencarian
Contoh
Setel pelengkapan otomatis di bidang pencarian ke nonaktif:
document.getElementById("mySearch").autocomplete = "off";
Definisi dan Penggunaan
Properti pelengkapan otomatis menyetel atau mengembalikan nilai atribut pelengkapan otomatis dalam bidang pencarian.
Saat pelengkapan otomatis aktif, browser secara otomatis melengkapi nilai berdasarkan nilai yang telah dimasukkan pengguna sebelumnya.
Tip: Di beberapa browser Anda mungkin perlu mengaktifkan fungsi pelengkapan otomatis agar ini berfungsi (Lihat di bawah "Preferensi" di menu browser).
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
autocomplete | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti pelengkapan otomatis:
searchObject.autocomplete
Setel properti pelengkapan otomatis:
searchObject.autocomplete = "on|off"
Nilai properti
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 text field for every use. The browser does not automatically complete entries |
Detail Teknis
Nilai Kembali: | Sebuah String, mewakili status pelengkapan otomatis |
---|
Lebih Banyak Contoh
Contoh
Kembalikan status pelengkapan otomatis:
var x = document.getElementById("mySearch").autocomplete;
Halaman Terkait
Referensi HTML: HTML <input> Atribut pelengkapan otomatis
Masukkan Objek Pencarian