HTML DOM ukuran Sandi properti
Definisi dan Penggunaan
ukuran set properti atau mengembalikan lebar kolom password (karakter numerik).
Nilai default adalah 20.
tatabahasa
Mengatur properti Ukuran:
passwordObject.size=integer
Pengembalian sifat size:
passwordObject.size
Dukungan Browser
Semua browser utama mendukung atribut ukuran
contoh
contoh
Mengatur lebar kolom Password:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi setResult () {
document.getElementById ( "pwd") size = 40 .;
}
</ Script>
</ Kepala>
<Body>
<Form>
Password: <input type = "password" id = "pwd">
</ Form>
<Jenis Tombol = "button" onclick = "setResult ()"> mengatur lebar </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi setResult () {
document.getElementById ( "pwd") size = 40 .;
}
</ Script>
</ Kepala>
<Body>
<Form>
Password: <input type = "password" id = "pwd">
</ Form>
<Jenis Tombol = "button" onclick = "setResult ()"> mengatur lebar </ button>
</ Body>
</ Html>
Coba »
Kata benda