Oggetto etichetta HTML DOM
Oggetto etichetta
L'oggetto Label rappresenta un elemento HTML <label>.
Accedi a un oggetto etichetta
Puoi accedere a un elemento <label> usando getElementById():
Esempio
var x = document.getElementById("myLabel");
Crea un oggetto etichetta
Puoi creare un elemento <label> usando il metodo document.createElement():
Esempio
var x = document.createElement("LABEL");
Etichetta proprietà oggetto
Property | Description |
---|---|
control | Returns the labeled control |
form | Returns a reference to the form that contains the label |
htmlFor | Sets or returns the value of the for attribute of a label |
Proprietà ed eventi standard
L'oggetto Label supporta anche le proprietà e gli eventi standard .
Pagine correlate
Esercitazione HTML: Moduli HTML
Riferimento HTML: tag HTML <etichetta>