bentuk sifat HTML DOM Hidden
Definisi dan Penggunaan
membentuk kembali properti untuk bentuk yang berisi referensi ke field input tersembunyi.
Properti ini mengembalikan objek bentuk.
tatabahasa
hiddenObject.form
Dukungan Browser
Semua browser utama mendukung sifat bentuk
contoh
contoh
Contoh berikut mengembalikan field input tersembunyi milik form id:
<html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("hidden1").form.id;
alert(x);
}
</script>
</head>
<body>
<form id="form1">
<input type="hidden" id="hidden1">
</form>
<button type="button" onclick="displayResult()">显示表单form的id</button>
</body>
</html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("hidden1").form.id;
alert(x);
}
</script>
</head>
<body>
<form id="form1">
<input type="hidden" id="hidden1">
</form>
<button type="button" onclick="displayResult()">显示表单form的id</button>
</body>
</html>
Coba »
Objek tersembunyi