Jenis properti HTML DOM Hidden
Definisi dan Penggunaan
Jenis properti mengembalikan jenis elemen form.
Untuk objek tersembunyi, atribut selalu "tersembunyi".
tatabahasa
hiddenObject.type
Dukungan Browser
Semua browser utama mendukung atribut Jenis
contoh
contoh
Contoh berikut mengembalikan jenis bidang bentuk elemen tersembunyi:
<html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("hidden1").type;
alert(x);
}
</script>
</head>
<body>
<form>
<input type="hidden" id="hidden1">
</form>
<button type="button" onclick="displayResult()">Display input type</button>
</body>
</html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("hidden1").type;
alert(x);
}
</script>
</head>
<body>
<form>
<input type="hidden" id="hidden1">
</form>
<button type="button" onclick="displayResult()">Display input type</button>
</body>
</html>
Coba »
Objek tersembunyi