Objeto oculto de entrada HTML DOM
Inserir Objeto Oculto
O objeto Input Hidden representa um elemento HTML <input> com type="hidden".
Acessar um objeto oculto de entrada
Você pode acessar um elemento <input> com type="hidden" usando getElementById():
Exemplo
var x = document.getElementById("myInput");
Dica: Você também pode acessar <input type="hidden"> pesquisando na coleção de elementos de um formulário.
Criar um objeto oculto de entrada
Você pode criar um elemento <input> com type="hidden" usando o método document.createElement():
Exemplo
var x = document.createElement("INPUT");
x.setAttribute("type", "hidden");
Propriedades de Objeto Oculto 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 |
Propriedades e eventos padrão
O objeto Input Hidden também suporta as propriedades e eventos padrão .
Páginas relacionadas
Tutorial HTML: Formulários HTML
Referência HTML: tag HTML <input>
Referência HTML: atributo de tipo HTML <input>