Quackit Logo

Got a MySpace Page?

Get "www.yourname.com" for your MySpace page. Learn how >>.

HTML label Tag

Print Version
 

The HTML label tag is used for adding a label to a form control.

If you use the label tag, in some browsers, users can select a radio button or checkbox option by clicking on its label.

Also see HTML form tag.

Example
<p>Which fruit would you like for lunch?</p>
<form>
<input type="radio" name="fruit" id="banana" />
<label for="banana">Banana</label>
<br />
<input type="radio" name="fruit" id="None" />
<label for="none">None</label>
</form>
Attributes:
Attributes specific to this tag:
AttributeDescription
forSpecifies the input control that this label is for. This value must be the same as the value in the input control's "id" attribute.
Other Attributes:
AttributeDescription
classDocument wide identifier.
idDocument wide identifier
dirSpecifies the direction of the text
langLanguage code
titleSpecifies a title to associate with the element. Many browsers will display this when the cursor hovers over the element (similar to a "tool tip").
styleInline style (CSS)
accesskeyAccess keys (or shortcut keys)
onfocusIntrinsic event (see event handlers)
onblurIntrinsic event (see event handlers)
onclickIntrinsic event (see event handlers)
ondbclickIntrinsic event (see event handlers)
onmousedownIntrinsic event (see event handlers)
onmouseupIntrinsic event (see event handlers)
onmouseoverIntrinsic event (see event handlers)
onmousemoveIntrinsic event (see event handlers)
onmouseoutIntrinsic event (see event handlers)
onkeypressIntrinsic event (see event handlers)
onkeydownIntrinsic event (see event handlers)
onkeyupIntrinsic event (see event handlers)
Try it yourself! HTML Editor


Also see the complete list of HTML tags


Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
                     
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!