label

The label element represents a caption for a form control.

Attributes

<label attribute-name="attribute-value"></label>
Name Value Description
accept mime-type list Provides the UA with a hint of what file types the server is able to accept
accept-charset character-encoding name list Specifies the character encodings used for form submission
action URI Submission action for the form
alt normal character data Fallback content for the image map
async async | empty Specifies that the script should be executed asynchronously, as soon as it becomes available - HTML5
autocomplete on | off Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later) - HTML5
autofocus autofocus | empty Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded - HTML5
autoplay autoplay | empty Automatically play when the page is loaded
challenge string Challenge string that is submitted along with the public key
charset character encoding name Specifies a character encoding name - HTML5
charset character encoding name Character encoding of the external script
checked checked | empty Specifies that the element represents a selected control
cite URI URL referencing the original source for the quoted material
cols positive integer Expected maximum number of characters per line of text for the UA to show
colspan positive integer Specifies the number of adjacent columns "spanned" by its td element
content string Specifies the value part of a name/value pair
controls controls | empty Display the controls
coords circle | polygon | rectangle Coordinates for the shape on the image map
crossorigin How the element handles crossorigin requests
data URI Address of the content
datetime date-time Time and date when the text was added/deleted
datetime date or time Specifies the date or time that the element represents
defer defer | empty Specifies that script should be executed after the document has been parsed
dir Direction of the text
dirname string Enables submission of a value for the directionality of the element, and gives the name of the field that contains that value
disabled disabled | empty Specifies that the element represents a disabled control
download string Download the hyperlink destination
enctype application/x-www-form-urlencoded | multipart/form-data | text/plain MIME type with which a UA is meant to associate the form contents for form submission
for IDREF Identifies a form control for which the label is a caption
for IDREFS Identifies one or more elements associated with the calculation whose result this output element represents
form IDREF Identifies a form with which to associate the element - HTML5
formaction URI Form-submission action for the element - HTML5
formenctype application/x-www-form-urlencoded | multipart/form-data | text/plain MIME type with which a UA is meant to associate this element for form submission - HTML5
formmethod get | post | put | delete HTTP method with which a UA is meant to associate this element for form submission - HTML5
formnovalidate formnovalidate | empty Specifies that the element represents a control whose value is not meant to be validated during form submission - HTML5
formtarget browsing-context name or keyword Browsing context or keyword that represents the target of the control - HTML5
headers IDREFS Identifies one or more th elements that apply to its td
height non-negative integer Height of the canvas in CSS pixels
high float Point that marks the lower boundary of the "high" segment of the meter
href URI Reference to the hyperlink destination
href URI Base URL for the document
hreflang language tag Language of the hyperlink destination
http-equiv refresh Indicates that the meta element is a pragma directive that specifies either a number of seconds after which to reload the current page, or a number of seconds after which to load a different page in place of the current page, and the URL for the replacement page
icon URI URL for an image that represents the command
ismap ismap | empty Specifies that its img element provides access to a server-side image map
keytype rsa Type of key generated
label string Specifies the label of the element
list IDREF Identifies a datalist with which to associate the element - HTML5
loop loop | empty Instructs the UA to seek back to the start of the audio stream upon reaching the end
low float Point that marks the upper boundary of the "low" segment of the meter
manifest URI Address of the document's application cache manifest (which controls caching of content for offline use) - HTML5
max date-time | local date-time | date | month | time | week | float Expected upper bound for the element's value - HTML5
max float Upper bound of the range
maxlength positive integer Maximum allowed value length of the element
media media query list Media for which the destination of the hyperlink was designed - HTML5
mediagroup string Instructs the UA to link multiple videos and/or audio streams together
method get | post | put | delete HTTP method with which a UA is meant to associate this element for form submission
min date-time | local date-time | date | month | time | week | float Expected lower bound for the element's value - HTML5
min float Lower bound of the range
multiple multiple | empty Specifies that the element allows multiple values - HTML5
muted muted | empty Represents the default state of the audio stream, potentially overriding user preferences
name string Name part of the name/value pair associated with this element for the purposes of form submission
name browsing-context name Valid browsing context name
name name Name by which the map can be referenced
name string Specifies the name part of a name/value pair
name string Name of the parameter
novalidate novalidate | empty Specifies that the element represents a form that is not meant to be validated during form submission - HTML5
onafterprint string Handles the event after printing
onbeforeprint string Handles the event before printing
onbeforeunload string Handles the event when the page is about to be unloaded, in case the page would like to show a warning prompt
onhashchange string Handles the event when the fragment identifier part of the document's current address changes
onmessage string Handles the event when the object receives a message
onoffline string Handles the event when the network connections fails
ononline string Handles the event when the network connections returns
onpagehide string Handles the event when the page's entry in the session history stops being the current entry
onpageshow string Handles the event when the page's entry in the session history becomes the current entry
onpopstate string Handles the event when the user navigates the session history
onredo string Handles the event when the user goes forward in the undo transaction history
onresize string Handles the event when the page is resized
onstorage string Handles the event when storage occurs
onundo string Handles the event when the user goes backward in the undo transaction history
onunload string Handles the event when the page is going away
open open | empty Specifies that the contents of the details element should be shown to the user
optimum float Point that marks the "optimum" position for the meter
pattern pattern Specifies a regular expression against which a UA is meant to check the value of the control represented by its element - HTML5
ping list of URIs List of URLs to notify if a user follows the hyperlink - HTML5
placeholder string Short hint (one word or a short phrase) intended to aid the user when entering data into the control represented by its element - HTML5
poster URI Address of an image file for the UA to show while no video data is available
preload auto | empty Hints to the UA that optimistically downloading the entire audio stream is considered desirable
metadata Hints to the UA that the user is not expected to need the audio stream, but that fetching its metadata (duration and so on) is desirable
none Hints to the UA that the user is not expected to need the audio stream, or that minimizing unnecessary traffic is desirable
pubdate pubdate | empty Indicates that the date and time given by the element is the publication date and time of the nearest ancestor article element - or, if the element has no ancestor article element, of the document as a whole
radiogroup string Name of the group of commands that will be toggled when the command itself is toggled
readonly readonly | empty Specifies that element represents a control whose value is not meant to be edited
rel tokens Relationship between the hyperlink document and the hyperlink destination
required required | empty Specifies that the element is a required part of form submission - HTML5
reversed reversed | empty Descending list if present, ascending list if not present - HTML5
rows positive integer Number of lines of text for the UA to show
rowspan non-negative integer Specifies the number of following rows "spanned" by its td element
sandbox sandbox allow list Instructs the UA to enable a set of extra restrictions on any content hosted by the iframe - HTML5
scope row | col | rowgroup | colgroup Specifies what set of cells the th element applies to
scoped scoped | empty Indicates that the specified style information is meant to apply only to the style element's parent element, and that element's child nodes. Otherwise, the specified styles are meant to apply to the entire document - HTML5
seamless seamless | empty Instructs the UA that the iframe element's browsing context is to be rendered in a manner that makes it appear to be part of the containing document (seamlessly included in the parent document) - HTML5
selected selected | empty Specifies that this option is pre-selected
shape circle | polygon | rectangle | default Specifies the shape of the area for the hyperlink on the image map
size positive integer Number of options meant to be shown by the control represented by its element
sizes any | sizes Sizes of icons for visual media - HTML5
span positive integer Number of columns in the group
src URI URL for the audio stream
srcdoc iframe srcdoc Content of the page that the nested browsing context is to contain - HTML5
start integer Ordinal value of the first list item
step any | positive float | positive integer Specifies the value granularity of the element's value - HTML5
summary string Prose description of the structure of the table
target browsing-context name or keyword Browsing context for the hyperlink destination
target browsing-context name or keyword Browsing context name or keyword for use in following hyperlinks - HTML5
target browsing-context name or keyword Browsing context or keyword that represents the target of the form
title string Expansion of the abbreviation
type MIME type Type of the hyperlink destination
type submit | reset | button Specifies that its button element is a button for submitting a form, for resetting a form, or with no additional semantics
type button | checkbox | color | date | datetime | datetime-local | email | file | hidden | image | month | number | password | radio | range | reset | search | submit | tel | text | time | url | week Specifies that its input element is a one-line plain-text edit control for the input element's value
type command | radio | checkbox Specifies that its command element is a command with an associated action, represents a selection of one item from a list of items, or represents a state or option that can be toggled
type MIME type MIME type of the content
type toolbar | context Kind of menu being declared
usemap hash-name reference Hash-name reference to a map element with which to associate the image
value string Specifies a value
value string Specifies a value for this input element
value integer Ordinal value of the list item. Permitted only if the li element is a child of an ol element
value float Measured value shown by meter
value string Value of the parameter
value Machine-readable value
width non-negative integer Width of the canvas in CSS pixels
wrap hard | Instructs the UA to insert line breaks into the submitted value of the textarea such that each line has no more characters than the value specified by the cols attribute
soft Instructs the UA to add no line breaks to the submitted value of the textarea
for IDREF Identifies a form control for which the label is a caption
form IDREF Identifies a form with which to associate the element - HTML5

Global

CSS

label {
  cursor: default;
}

Example | for

Example | form

Example | CSS

External

W3C HTML 4.01 Specification

W3C HTML5

W3C HTML 5.1