asp.net.ph

Skip Navigation LinksHome > Abakada: Back to Basics > Language References > HTML Elements > LABEL Element

<LABEL Element | LABEL Object


Specifies a label for a form control.HTML 4, 4.01, 5

HTML Syntax

Remarks

Some form controls automatically have labels associated with them [push buttons], while most do not [text fields, checkboxes, radio buttons and menus].

For those controls that have implicit labels, browsers use the value of the value attribute as the label string.

The LABEL element is used to specify labels for controls that do not have implicit labels.

If the user clicks the label with the mouse, the onclick event goes to the label and then bubbles to the control specified by the htmlFor property. Pressing the accesskey for the label is the same as clicking the mouse on the label.

Labels cannot be nested.

NOTE: Both start and end tags are required.

Attributes

The <label> element supports the following attributes, in addition to global attributes common to all HTML elements.

AttributeValueDescription
forelement_idSpecifies the id of the form element the label should be bound to
formform_idSpecifies which form the label belongs to
See Also

accessKey



Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note