HTML <label> tag
An simple HTML form with two input fields and related labels :
<input type="radio" name="sex" id="male" />
<input type="radio" name="sex" id="female" />
Try it yourself!
Definition and Usage
The <label> tag defines a label for an input element.
The label element does not render as anything special for the user. However,
it provides a usability improvement for mouse users, because if the user clicks
on the text within the label element, it toggles the control.
The for attribute of the <label> tag should be equal to the id attribute of
the related element to bind them together.
The <label> tag is supported in all major browsers.
Note: Not supported in Safari 2 or earlier versions.
Differences Between HTML and XHTML
DTD indicates in which DTD the attribute is
allowed. S=Strict, T=Transitional, and F=Frameset.
||Defines which form element the label is for.
Note: If this attribute is not specified, the label is
associated with its contents.
|id, class, title, style, dir, lang, xml:lang, accesskey
For a full description, go to Standard
|onfocus, onblur, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
For a full description, go to Event
Learn XML with <oXygen/> XML Editor - Free Trial!
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
and from the video
Download a FREE 30-day trial today!