Objeto oculto de entrada HTML DOM
Introducir objeto oculto
El objeto Input Hidden representa un elemento HTML <input> con type="hidden".
Acceder a un objeto oculto de entrada
Puede acceder a un elemento <input> con type="hidden" usando getElementById():
Ejemplo
var x = document.getElementById("myInput");
Sugerencia: también puede acceder a <input type="hidden"> buscando en la colección de elementos de un formulario.
Crear un objeto oculto de entrada
Puede crear un elemento <input> con type="hidden" utilizando el método document.createElement():
Ejemplo
var x = document.createElement("INPUT");
x.setAttribute("type", "hidden");
Propiedades de objetos ocultos de entrada
Property | Description |
---|---|
defaultValue | Sets or returns the default value of the hidden input field |
form | Returns a reference to the form that contains the hidden input field |
name | Sets or returns the value of the name attribute of the hidden input field |
type | Returns which type of form element a hidden input field is |
value | Sets or returns the value of the value attribute of the hidden input field |
Propiedades y eventos estándar
El objeto Input Hidden también es compatible con las propiedades y eventos estándar .
páginas relacionadas
Tutorial de HTML: formularios HTML
Referencia HTML: etiqueta HTML <input>
Referencia HTML: atributo de tipo HTML <entrada>