HTML DOM ulang jenis properti
Definisi dan Penggunaan
Jenis properti mengembalikan tombol reset jenis bentuk elemen.
Untuk tombol konfirmasi, atribut ini selalu "reset".
tatabahasa
resetObject.type
Dukungan Browser
Semua browser utama mendukung atribut Jenis
contoh
contoh
Contoh berikut mengembalikan Jenis ulang tombol bentuk elemen:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi displayResult () {
var x = document.getElementById ( "reset1") ketik .;
alert (x);
}
</ Script>
</ Kepala>
<Body>
<Form>
Email: <input type = "text" id = "email">
<Input type = "reset" id = "reset1">
</ 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 ( "reset1") ketik .;
alert (x);
}
</ Script>
</ Kepala>
<Body>
<Form>
Email: <input type = "text" id = "email">
<Input type = "reset" id = "reset1">
</ Form>
<Tombol type = "button" onclick = "displayResult ()"> jenis input Tampilan </ button>
</ Body>
</ Html>
Coba »
benda ulang