HTML DOM Input oggetto nascosto
Inserisci oggetto nascosto
L'oggetto Input nascosto rappresenta un elemento HTML <input> con type="hidden".
Accedi a un oggetto nascosto di input
Puoi accedere a un elemento <input> con type="hidden" usando getElementById():
Esempio
var x = document.getElementById("myInput");
Suggerimento: puoi anche accedere a <input type="hidden"> cercando nella raccolta di elementi di un modulo.
Crea un oggetto nascosto di input
Puoi creare un elemento <input> con type="hidden" usando il metodo document.createElement():
Esempio
var x = document.createElement("INPUT");
x.setAttribute("type", "hidden");
Inserisci le proprietà degli oggetti nascosti
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 |
Proprietà ed eventi standard
L'oggetto nascosto Input supporta anche le proprietà e gli eventi standard .
Pagine correlate
Esercitazione HTML: moduli HTML
Riferimento HTML: tag HTML <input>
Riferimento HTML: attributo tipo HTML <input>