Easy Tutorial
❮ Prop Html Accesskey Jsref Copywithin ❯

HTML DOM Label Object


Label Object

The Label object represents an HTML <keygen> element.

Accessing Label Object

You can use getElementById() to access a <label> element:

Creating Label Object

You can use the document.createElement() method to create a <label> element:

Label Object Properties

Property Description
control Returns the control that is labeled.
form Returns a reference to the form that contains the label.
htmlFor Sets or returns the value of the for attribute of the label.

Standard Properties and Events

The Label object also supports standard properties and events.


Related Articles

HTML Tutorial: HTML Forms

HTML Reference: HTML <label> Tag

❮ Prop Html Accesskey Jsref Copywithin ❯