HTML DOM Kirim sifat bentuk
Definisi dan Penggunaan
bentuk properti mengembalikan tombol konfirmasi pada formulir yang berisi referensi.
Jika berhasil, properti mengembalikan sebuah objek bentuk.
tatabahasa
submitObject.form
Dukungan Browser
Semua browser utama mendukung sifat bentuk
contoh
contoh
mengikuti contoh akan mengembalikan formulir ke tombol konfirmasi milik id:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi displayResult () {
var x = document.getElementById ( "submit1") form.id .;
alert (x);
}
</ Script>
</ Kepala>
<Body>
<Form id = "form1">
Email: <input type = "text" id = "email">
<Input type = "submit" id = "submit1">
</ Form>
<Tombol type = "button" onclick = "displayResult ()"> Tampilan bentuk yang relevan ID </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi displayResult () {
var x = document.getElementById ( "submit1") form.id .;
alert (x);
}
</ Script>
</ Kepala>
<Body>
<Form id = "form1">
Email: <input type = "text" id = "email">
<Input type = "submit" id = "submit1">
</ Form>
<Tombol type = "button" onclick = "displayResult ()"> Tampilan bentuk yang relevan ID </ button>
</ Body>
</ Html>
Coba »
menyerahkan benda