HTML DOM Label object
Label object
The Label object represents the HTML <label> element.
Access Label object
You can access the <label> element by using getElementById():
var x = document.getElementById("myLabel");
Create Label object
You can create a <label> element by using the document.createElement() method:
var x = document.createElement("LABEL");
Label object properties
Properties | Description |
---|---|
control | Return the marked control. |
form | Returns a reference to the form containing the label. |
htmlFor | Sets or returns the value of the label's for attribute. |
Standard properties and events
Label object supports standardsPropertiesandEvents.