propiedades de formulario HTML DOM ocultos
Definición y Uso
formar retornos de propiedad a la forma que contiene una referencia a un campo de entrada oculto.
Esta propiedad devuelve el objeto de formulario.
gramática
hiddenObject.form
Soporte para el navegador
Todos los principales navegadores soportan las propiedades del formulario
Ejemplos
Ejemplos
El siguiente ejemplo devuelve el campo de entrada oculto pertenece al formulario de Identificación:
<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>
Trate »
Objetos ocultos