HTML DOM bentuk Kata sifat
Kata benda
Definisi dan Penggunaan
membentuk kembali properti yang berisi referensi bidang password untuk formulir.
Properti ini mengembalikan sebuah objek bentuk.
tatabahasa
passwordObject.form
Dukungan Browser
Semua browser utama mendukung sifat bentuk
contoh
contoh
Contoh berikut telah membuat kolom password milik form id:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi displayResult () {
var x = document.getElementById ( "pwd") form.id .;
alert (x);
}
</ Script>
</ Kepala>
<Body>
<Form id = "form1">
Password: <input type = "password" id = "pwd">
</ Form>
<Tombol type = "button" onclick = "displayResult ()"> display form id milik </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi displayResult () {
var x = document.getElementById ( "pwd") form.id .;
alert (x);
}
</ Script>
</ Kepala>
<Body>
<Form id = "form1">
Password: <input type = "password" id = "pwd">
</ Form>
<Tombol type = "button" onclick = "displayResult ()"> display form id milik </ button>
</ Body>
</ Html>
Coba »
Kata benda