HTML DOM Jenis Sandi properti
Definisi dan Penggunaan
Jenis properti mengembalikan jenis elemen form.
Untuk bidang sandi, properti ini selalu "password".
tatabahasa
passwordObject.type
Dukungan Browser
Semua browser utama mendukung atribut Jenis
contoh
contoh
Contoh berikut mengembalikan jenis bentuk elemen bidang sandi:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi displayResult () {
var x = document.getElementById ( "pwd") ketik .;
alert (x);
}
</ Script>
</ Kepala>
<Body>
<Form>
Password: <input type = "password" id = "pwd">
</ Form>
<Tombol type = "button" onclick = "displayResult ()"> jenis input Tampilan </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi displayResult () {
var x = document.getElementById ( "pwd") ketik .;
alert (x);
}
</ Script>
</ Kepala>
<Body>
<Form>
Password: <input type = "password" id = "pwd">
</ Form>
<Tombol type = "button" onclick = "displayResult ()"> jenis input Tampilan </ button>
</ Body>
</ Html>
Coba »
Kata benda