Objeto de etiqueta HTML DOM
Objeto de etiqueta
El objeto Label representa un elemento HTML <label>.
Acceder a un objeto de etiqueta
Puede acceder a un elemento <label> usando getElementById():
Ejemplo
var x = document.getElementById("myLabel");
Crear un objeto de etiqueta
Puede crear un elemento <label> utilizando el método document.createElement():
Ejemplo
var x = document.createElement("LABEL");
Propiedades del objeto de etiqueta
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 |
Propiedades y eventos estándar
El objeto Label también admite las propiedades y los eventos estándar .
páginas relacionadas
Tutorial de HTML: formularios HTML
Referencia HTML: etiqueta HTML <etiqueta>