Living Standard — Last Updated 24 September 2023
button
elementSupport in all current engines.
Support in all current engines.
tabindex
attribute
specified.disabled
— Whether the form control is disabledform
— Associates the element with a form
elementformaction
— URL to use for form submissionformenctype
— Entry list encoding type to use for form submissionformmethod
— Variant to use for form submissionformnovalidate
— Bypass form control validation for form submissionformtarget
— Navigable for form submissionname
— Name of the element to use for form submission and in the form.elements
API popovertarget
— Targets a popover element to toggle, show, or hidepopovertargetaction
— Indicates whether a targeted popover element is to be toggled, shown, or hiddentype
— Type of buttonvalue
— Value to be used for form submission[Exposed =Window ]
interface HTMLButtonElement : HTMLElement {
[HTMLConstructor ] constructor ();
[CEReactions ] attribute boolean disabled ;
readonly attribute HTMLFormElement ? form ;
[CEReactions ] attribute USVString formAction ;
[CEReactions ] attribute DOMString formEnctype ;
[CEReactions ] attribute DOMString formMethod ;
[CEReactions ] attribute boolean formNoValidate ;
[CEReactions ] attribute DOMString formTarget ;
[CEReactions ] attribute DOMString name ;
[CEReactions ] attribute DOMString type ;
[CEReactions ] attribute DOMString value ;
readonly attribute boolean willValidate ;
readonly attribute ValidityState validity ;
readonly attribute DOMString validationMessage ;
boolean checkValidity ();
boolean reportValidity ();
undefined setCustomValidity (DOMString error );
readonly attribute NodeList labels ;
};
HTMLButtonElement includes PopoverInvokerElement ;
The button
element represents a button labeled by its contents.
The element is a button.
The type
attribute
controls the behavior of the button when it is activated. It is an enumerated
attribute. The following table lists the keywords and states for the attribute — the
keywords in the left column map to the states in the cell in the second column on the same row as
the keyword.
Keyword | State | Brief description |
---|---|---|
submit
| Submit Button | Submits the form. |
reset
| Reset Button | Resets the form. |
button
| Button | Does nothing. |
The missing value default and invalid value default are the Submit Button state.
If the type
attribute is in the Submit Button state, the element is specifically a
submit button.
Constraint validation: If the type
attribute is in the Reset Button state or the
Button state, the element is barred from
constraint validation.
A button
element element's activation behavior given
event is:
If element is disabled, then return.
If element's node document is not fully active, then return.
If element has a form owner then switch on element's type
attribute's state, then:
Submit element's form owner from element with userInvolvement set to event's user navigation involvement.
Reset element's form owner.
Do nothing.
Run the popover target attribute activation behavior given element.
The form
attribute is used to explicitly associate the
button
element with its form owner. The name
attribute represents the element's name. The disabled
attribute is used to make the control non-interactive and
to prevent its value from being submitted. The formaction
,
formenctype
, formmethod
, formnovalidate
, and formtarget
attributes are attributes for form
submission.
The formnovalidate
attribute can be
used to make submit buttons that do not trigger the constraint validation.
The formaction
, formenctype
, formmethod
, formnovalidate
, and formtarget
must not be specified if the element's type
attribute is not in the Submit Button state.
The value
attribute gives the element's value for the purposes of form submission. The element's value is the value of the element's value
attribute, if there is one, or the empty string
otherwise.
A button (and its value) is only included in the form submission if the button itself was used to initiate the form submission.
The value
IDL attribute must reflect the content attribute of the same name.
The type
IDL
attribute must reflect the content attribute of the same name, limited to only
known values.
The willValidate
, validity
, and validationMessage
IDL attributes, and the checkValidity()
, reportValidity()
, and setCustomValidity()
methods, are part of the
constraint validation API. The labels
IDL
attribute provides a list of the element's label
s. The disabled
, form
, and
name
IDL attributes are part of the element's forms API.
The following button is labeled "Show hint" and pops up a dialog box when activated:
< button type = button
onclick = "alert('This 15-20 minute piece was composed by George Gershwin.')" >
Show hint
</ button >
select
elementSupport in all current engines.
Support in all current engines.
option
, optgroup
, hr
, and script-supporting elements.autocomplete
— Hint for form autofill featuredisabled
— Whether the form control is disabledform
— Associates the element with a form
elementmultiple
— Whether to allow multiple valuesname
— Name of the element to use for form submission and in the form.elements
API required
— Whether the control is required for form submissionsize
— Size of the controlmultiple
attribute or a size
attribute with a value > 1: for authors; for implementers.[Exposed =Window ]
interface HTMLSelectElement : HTMLElement {
[HTMLConstructor ] constructor ();
[CEReactions ] attribute DOMString autocomplete ;
[CEReactions ] attribute boolean disabled ;
readonly attribute HTMLFormElement ? form ;
[CEReactions ] attribute boolean multiple ;
[CEReactions ] attribute DOMString name ;
[CEReactions ] attribute boolean required ;
[CEReactions ] attribute unsigned long size ;
readonly attribute DOMString type ;
[SameObject ] readonly attribute HTMLOptionsCollection options ;
[CEReactions ] attribute unsigned long length ;
getter HTMLOptionElement ? item (unsigned long index );
HTMLOptionElement ? namedItem (DOMString name );
[CEReactions ] undefined add ((HTMLOptionElement or HTMLOptGroupElement ) element , optional (HTMLElement or long )? before = null );
[CEReactions ] undefined remove (); // ChildNode overload
[CEReactions ] undefined remove (long index );
[CEReactions ] setter undefined (unsigned long index , HTMLOptionElement ? option );
[SameObject ] readonly attribute HTMLCollection selectedOptions ;
attribute long selectedIndex ;
attribute DOMString value ;
readonly attribute boolean willValidate ;
readonly attribute ValidityState validity ;
readonly attribute DOMString validationMessage ;
boolean checkValidity ();
boolean reportValidity ();
undefined setCustomValidity (DOMString error );
readonly attribute NodeList labels ;
};
The select
element represents a control for selecting amongst a set of
options.
Support in all current engines.
The multiple
attribute is a boolean attribute. If the attribute is present, then the
select
element represents a control for selecting zero or more options
from the list of options. If the attribute is
absent, then the select
element represents a control for selecting a
single option from the list of options.
Support in all current engines.
The size
attribute
gives the number of options to show to the user. The size
attribute, if specified, must have a value that is a valid non-negative integer
greater than zero.
The display size of a select
element is the
result of applying the rules for parsing non-negative integers to the value of
element's size
attribute, if it has one and parsing it is
successful. If applying those rules to the attribute's value is not successful, or if the size
attribute is absent, then the element's display size is 4 if the element's multiple
content attribute is present, and 1 otherwise.
The list of options for a select
element consists of all the option
element children of the select
element, and all the option
element children of all the optgroup
element
children of the select
element, in tree order.
Support in all current engines.
The required
attribute is a boolean attribute. When specified, the user will be required to select
a value before submitting the form.
If a select
element has a required
attribute specified, does not have a multiple
attribute
specified, and has a display size of 1; and if the value of the first option
element in the
select
element's list of options (if
any) is the empty string, and that option
element's parent node is the
select
element (and not an optgroup
element), then that
option
is the select
element's placeholder label option.
If a select
element has a required
attribute specified, does not have a multiple
attribute
specified, and has a display size of 1, then the
select
element must have a placeholder label option.
In practice, the requirement stated in the paragraph above can only apply when a
select
element does not have a size
attribute
with a value greater than 1.
Constraint validation: If the element has its required
attribute specified, and either none of the
option
elements in the select
element's list of options have their selectedness set to true, or the only
option
element in the select
element's list of options with its selectedness set to true is the placeholder label
option, then the element is suffering from being missing.
If the multiple
attribute is absent, and the element
is not disabled, then the user agent should allow the
user to pick an option
element in its list
of options that is itself not disabled. Upon
this option
element being picked (either
through a click, or through unfocusing the element after changing its value, or through a menu command, or through any other mechanism), and before the
relevant user interaction event is queued (e.g. before the
click
event), the user agent must set the selectedness of the picked option
element
to true, set its dirtiness to true, and then
send select
update notifications.
If the multiple
attribute is absent, whenever an
option
element in the select
element's list of options has its selectedness set to true, and whenever an
option
element with its selectedness set to true is added to the
select
element's list of options,
the user agent must set the selectedness of all
the other option
elements in its list of
options to false.
If the multiple
attribute is absent and the
element's display size is greater than 1, then the user
agent should also allow the user to request that the option
whose selectedness is true, if any, be unselected. Upon this
request being conveyed to the user agent, and before the relevant user interaction event is queued (e.g. before the click
event), the user agent must set the selectedness of that option
element to
false, set its dirtiness to true, and then
send select
update notifications.
The selectedness setting algorithm, given a select
element
element, is to run the following steps:
If element's multiple
attribute is
absent, and element's display size is 1,
and no option
elements in the element's list of options have their selectedness set to true, then set the selectedness of the first option
element in the list of options in
tree order that is not disabled,
if any, to true, and return.
If element's multiple
attribute is
absent, and two or more option
elements in element's list of options have their selectedness set to true, then set the selectedness of all but the last option
element with its selectedness set to true in
the list of options in tree order
to false.
The option
HTML element insertion
steps, given insertedNode, are:
If insertedNode's parent is a select
element, or
insertedNode's parent is an optgroup
element whose parent is a
select
element, then run that select
element's selectedness
setting algorithm.
The option
HTML element removing
steps, given removedNode and oldParent, are:
If oldParent is a select
element, or oldParent is an
optgroup
element whose parent is a select
element, then run that
select
element's selectedness setting algorithm.
The optgroup
HTML element removing
steps, given removedNode and oldParent, are:
If oldParent is a select
element and removedNode has an
option child, then run oldParent's selectedness setting
algorithm.
If an option
element in the list of
options asks for a reset, then run that
select
element's selectedness setting algorithm.
If the multiple
attribute is present, and the
element is not disabled, then the user agent should
allow the user to toggle the selectedness of the option
elements in
its list of options that are themselves not disabled. Upon such an element being toggled (either through a click, or through a menu command, or any other mechanism), and before the relevant user
interaction event is queued (e.g. before a related click
event), the selectedness of the option
element must
be changed (from true to false or false to true), the dirtiness of the element must be set to true, and the
user agent must send select
update notifications.
When the user agent is to send select
update notifications, queue
an element task on the user interaction task source given the select
element to run these steps:
select
element's user interacted to true.Fire an event named Fire an event named The reset algorithm for a Set selectElement's user interacted to false. For each optionElement of
selectElement's list of
options: If optionElement has a Set optionElement's dirtiness
to false. Run the selectedness setting algorithm given
selectElement.
The A Support in all current engines. Returns " Support in all current engines. Returns an Returns the number of elements in the list of
options. When set to a smaller number, truncates the number of When set to a greater number, adds new blank Support in all current engines. Returns the item with index index from the list of options. The items are sorted in tree
order. Support in all current engines. Returns the first item with ID or Returns null if no element with that ID could be found. Support in all current engines. Inserts element before the node given by before. The before argument can be a number, in which case element is inserted
before the item with that number, or an element from the list of options, in which case element is
inserted before that element. If before is omitted, null, or a number out of range, then element will
be added at the end of the list. This method will throw a " HTMLSelectElement/selectedOptions Support in all current engines. Returns an HTMLSelectElement/selectedIndex Support in all current engines. Returns the index of the first selected item, if any, or −1 if there is no selected
item. Can be set, to change the selection. Returns the value of the first selected item, if
any, or the empty string if there is no selected item. Can be set, to change the selection. The The The The The The When the user agent is to set the value of a new indexed
property or set the value of an existing indexed property for a
Similarly, the Support in all current engines. The The The On setting, the This can result in no element having a selectedness set to true even in the case of the
The On setting, the This can result in no element having a selectedness set to true even in the case of the
The For historical reasons, the default value of the The The following example shows how a When there is no default option, a placeholder can be used instead: Here, the user is offered a set of options from which they can select any number. By default,
all five options are selected. Sometimes, a user has to select one or more items. This example shows such an interface. Occasionally it can be useful to have a separator:
Support in all current engines. The The In the more elaborate case, the The Each The Constraint validation: If an element has a Support in all current engines. Support in all current engines. The The element's group of When showing Support in all current engines. The The The There is no way to select an The following snippet shows how a set of lessons from three courses could be offered in a
Support in all current engines. Support in all current engines. The In certain circumstances described in the definition of the Support in all current engines. The An The The The The The dirtiness of an The selectedness of an The A An Returns true if the element is selected, and false otherwise. Can be set, to override the current state of the element. Returns the index of the element in its Returns the element's Same as Support in all current engines. Returns a new The text argument sets the contents of the element. The value argument sets the The defaultSelected argument sets the The selected argument sets whether or not the element is selected. If it is
omitted, even if the defaultSelected argument is true, the element is not
selected. The The The The The The The The A legacy factory function is provided for creating Let document be the current global object's associated Let option be the result of creating an
element given document, If text is not the empty string, then append to option a new
If value is given, then set
an attribute value for option using " If defaultSelected is true, then set an attribute value for option
using " If selected is true, then set option's selectedness to true; otherwise set its selectedness to false (even if
defaultSelected is true). Return option. Support in all current engines. Support in all current engines. The The raw value of a This element has rendering requirements involving the
bidirectional algorithm. The In this example, a text control is marked read-only because it represents a read-only
file: Constraint validation: If the A When a A The cloning steps for The children changed steps for The reset algorithm for When a If the element is mutable, the user agent should allow
the user to change the writing direction of the element, setting it either to a left-to-right
writing direction or a right-to-left writing direction. If the user does so, the user agent must
then run the following steps: Set the element's Queue an element task on the user interaction task source given
the The The user agent may use the The Visual user agents should set the height of the control to the number of lines given by character height. The The Soft state indicates that the text in the
The Hard state indicates that the text in the
If the element's For historical reasons, the element's value is normalized in three different ways for three
different purposes. The raw value is the value as
it was originally set. It is not normalized. The API
value is the value used in the The algorithm for obtaining
the element's API value is to return the element's
raw value, with newlines normalized. The element's value is defined to be the element's API value with the textarea wrapping
transformation applied. The textarea wrapping transformation is the following
algorithm, as applied to a string: If the element's The If the The The Constraint validation: If the element has its The The These mechanisms are very similar but subtly different: the hint given by the
control's User agents should present this hint to the user when the element's value is the empty string and the control is not
focused (e.g. by displaying it inside a blank unfocused control). All U+000D CARRIAGE
RETURN U+000A LINE FEED character pairs (CRLF) in the hint, as well as all other U+000D CARRIAGE
RETURN (CR) and U+000A LINE FEED (LF) characters in the hint, must be treated as line breaks when
rendering the hint. If a user agent normally doesn't show this hint to the user when the control is
focused, then the user agent should nonetheless show the hint for the control if it
was focused as a result of the
The Returns the string " Returns the current value of the element. Can be set, to change the value. The The The The The Let oldAPIValue be this element's API value. Set this element's raw value to the new
value. Set this element's dirty value flag to
true. If the new API value is different from
oldAPIValue, then move the text entry
cursor position to the end of the text control, unselecting any selected text and resetting the selection direction to " The The Here is an example of a To specify a maximum length for the comments, one can use the To give a default value, text can be included inside the element: You can also give a minimum length. Here, a letter needs to be filled out by the user; a
template (which is shorter than the minimum length) is provided, but is insufficient to submit
the form: A placeholder can be given as well, to suggest the basic form to the user, without providing
an explicit template: To have the browser submit the directionality of the element along with the
value, the Support in all current engines. Support in all current engines. The This element can be contrasted with the Support in all current engines. The The The element has a default value
override (null or a string). Initially it must be null. The element's default value is determined by
the following steps: If this element's default value
override is non-null, then return it. Return this element's descendant text content. The reset algorithm for String replace all with this element's default value within this element. Set this element's default value
override to null. Returns the element's current value. Can be set, to change the value. Returns the element's current default value. Can be set, to change the default value. Returns the string " The The Set this's default value
override to its default value. String replace all with the given value within this. The The If this's default value
override is null, then string replace all with the given value within
this and return. Set this's default value
override to the given value. The The The A simple calculator could use In this example, an Support in all current engines. Support in all current engines. The Support in all current engines. There are two attributes that determine the current task completion represented by the element.
The To make a determinate progress bar, add a Authors are encouraged to also include the current value and the maximum value inline as text
inside the element, so that the progress is made available to users of legacy user agents. Here is a snippet of a web application that shows the progress of some automated task: (The The The User agent requirements: If the If the progress bar is a determinate progress bar and the element has a If the progress bar is a determinate progress bar, user agents must parse the If the progress bar is a determinate progress bar, then the current value is the maximum value, if value is greater than the maximum value, and value otherwise. UA requirements for showing the progress bar: When representing a
For a determinate progress bar (one with known current and maximum values), returns the
result of dividing the current value by the maximum value. For an indeterminate progress bar, returns −1. If the progress bar is an indeterminate progress bar, then the If the progress bar is an indeterminate progress bar, then the Setting the The The Support in all current engines. Support in all current engines. The This is also known as a gauge. The The There are six attributes that determine the semantics of the gauge represented by the
element. Support in all current engines. Support in all current engines. The The other three attributes can be used to segment the gauge's range into "low", "medium", and
"high" parts, and to indicate which part of the gauge is the "optimum" part. The Authoring requirements: The In addition, the attributes' values are further constrained: Let value be the If the If the The following inequalities must hold, as applicable: If no minimum or maximum is specified, then the range is assumed to be 0..1, and
the value thus has to be within that range. Authors are encouraged to include a textual representation of the gauge's state in the
element's contents, for users of user agents that do not support the When used with microdata, the The following examples show three gauges that would all be three-quarters full: The following example is incorrect use of the element, because it doesn't give a range (and
since the default maximum is 1, both of the gauges would end up looking maxed out): Instead, one would either not include the meter element, or use the meter element with a
defined range to give the dimensions in context compared to other pies: There is no explicit way to specify units in the The example above could be extended to mention the units: User agent requirements: User agents must parse the User agents must then use all these numbers to obtain values for six points on the gauge, as
follows. (The order in which these are evaluated is important, as some of the values refer to
earlier ones.) If the If the If the candidate maximum value is greater than or equal to the minimum value, then the
maximum value is the candidate maximum value. Otherwise, the maximum value is the same as the
minimum value. If the If the candidate actual value is less than the minimum value, then the actual value is the
minimum value. Otherwise, if the candidate actual value is greater than the maximum value, then the actual
value is the maximum value. Otherwise, the actual value is the candidate actual value. If the If the candidate low boundary is less than the minimum value, then the low boundary is the
minimum value. Otherwise, if the candidate low boundary is greater than the maximum value, then the low
boundary is the maximum value. Otherwise, the low boundary is the candidate low boundary. If the If the candidate high boundary is less than the low boundary, then the high boundary is the
low boundary. Otherwise, if the candidate high boundary is greater than the maximum value, then the high
boundary is the maximum value. Otherwise, the high boundary is the candidate high boundary. If the If the candidate optimum point is less than the minimum value, then the optimum point is the
minimum value. Otherwise, if the candidate optimum point is greater than the maximum value, then the optimum
point is the maximum value. Otherwise, the optimum point is the candidate optimum point. All of which will result in the following inequalities all being true: UA requirements for regions of the gauge: If the optimum point is equal to the
low boundary or the high boundary, or anywhere in between them, then the region between the low
and high boundaries of the gauge must be treated as the optimum region, and the low and high
parts, if any, must be treated as suboptimal. Otherwise, if the optimum point is less than the low
boundary, then the region between the minimum value and the low boundary must be treated as the
optimum region, the region from the low boundary up to the high boundary must be treated as a
suboptimal region, and the remaining region must be treated as an even less good region. Finally,
if the optimum point is higher than the high boundary, then the situation is reversed; the region
between the high boundary and the maximum value must be treated as the optimum region, the region
from the high boundary down to the low boundary must be treated as a suboptimal region, and the
remaining region must be treated as an even less good region. UA requirements for showing the gauge: When representing a The following markup: Might be rendered as follows: User agents may combine the value of the For example, the following snippet: ...might cause the user agent to display a gauge with a tooltip
saying "Value: 23.2 out of 60." on one line and "seconds" on a
second line. The The The The The The The The following example shows how a gauge could fall back to localized or pretty-printed
text. Support in all current engines. Support in all current engines. The Element/fieldset#attr-disabled Support in all current engines. The A The Returns the string "fieldset". Returns an The The The The This example shows a The following snippet shows a fieldset with a checkbox in the legend that controls whether or
not the fieldset is enabled. The contents of the fieldset consist of two required text controls
and an optional year/month control. You can also nest In this example, if the outer "Use Club Card" checkbox is not checked, everything inside the
outer This example shows a grouping of controls where the Support in all current engines. Support in all current engines. The The input
at the select
element, with the change
at the select
element, with the
select
element selectElement is:selected
attribute, then set optionElement's selectedness to true; otherwise set it to
false.form
attribute is used to explicitly associate the select
element with its form owner.
The name
attribute represents the element's name.
The disabled
attribute is used to make the control non-interactive and to prevent its value from being submitted.
The autocomplete
attribute controls how the user agent provides autofill behavior.
select
element that is not disabled is
mutable.select.type
Opera2+Edge79+
Edge (Legacy)12+Internet Explorer1+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android10.1+select-multiple
" if the element has a multiple
attribute, and "select-one
"
otherwise.select.options
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+HTMLOptionsCollection
of the list of options.select.length [ = value ]
option
elements in the
select
.option
elements to the
select
.element = select.item(index)
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+select[index]
element = select.namedItem(name)
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer6+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+name
name from the list of options.select.add(element [, before ])
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+HierarchyRequestError
"
element is an ancestor of the element into which it is
to be inserted.
select.selectedOptions
Opera9+Edge79+
Edge (Legacy)12+Internet ExplorerNo
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android10.1+list
of options that are selected.
select.selectedIndex [ = value ]
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+select.value [ = value ]
type
IDL
attribute, on getting, must return the string "select-one
" if the multiple
attribute is absent, and the string "select-multiple
" if the multiple
attribute is present.options
IDL attribute must return an
HTMLOptionsCollection
rooted at the select
node, whose filter matches
the elements in the list of options.options
collection is also mirrored on the
HTMLSelectElement
object. The supported property indices at any instant
are the indices supported by the object returned by the options
attribute at that instant.length
IDL attribute must return the number of nodes represented by the options
collection.
On setting, it must act like the attribute of the same name on the options
collection.item(index)
method must return the value returned
by the method of the same name on the options
collection, when invoked with the same argument.namedItem(name)
method must return the value
returned by the method of the same name on the
options
collection, when invoked with the same
argument.select
element, it must instead run the
corresponding algorithm on the select
element's options
collection.add(element, before)
method must act
like its namesake method on that same options
collection.
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+remove()
method must act like its namesake method on that same options
collection when it has arguments, and like its namesake
method on the HTMLSelectElement
ancestor interface
selectedOptions
IDL attribute must return an
select
node, whose filter matches the
elements in the list of options that have their
selectedness set to true.selectedIndex
IDL attribute, on getting, must
return the index of the first option
element in the list of options in tree
order that has its selectedness set to
true, if any. If there isn't one, then it must return −1.selectedIndex
attribute must set
the selectedness of all the option
elements in the list of options to false, and
then the option
element in the list of
options whose index is the given new value, if
any, must have its selectedness set to true and
its dirtiness set to true.select
element having no multiple
attribute and a display size of 1.value
IDL attribute, on getting, must return the value of the
first option
element in the list of
options in tree order that has its selectedness set to true, if any. If there isn't one,
then it must return the empty string.value
attribute must set the selectedness of all the option
elements
in the list of options to false, and then the
first option
element in the list of
options, in tree order, whose value
is equal to the given new value, if any, must have its selectedness set to true and its dirtiness set to true.select
element having no multiple
attribute and a display size of 1.multiple
, required
, and size
IDL attributes must
reflect the respective content attributes of the same name. The size
IDL attribute has a default value of 0.size
IDL attribute does not return the actual size used, which, in
the absence of the size
content attribute, is either 1 or 4
depending on the presence of the multiple
attribute.willValidate
, validity
, and validationMessage
IDL attributes, and the checkValidity()
, reportValidity()
, and setCustomValidity()
methods, are part of the
constraint validation API. The labels
IDL
attribute provides a list of the element's label
s. The disabled
, form
, and
name
IDL attributes are part of the element's forms API.select
element can be used to offer the user
with a set of options from which the user can select a single option. The default option is
preselected.4.10.8 The
datalist
element
Opera9.5+Edge79+
Edge (Legacy)12+Internet Explorer10+
Firefox Android🔰 79+Safari iOS?Chrome Android33+WebView Android?Samsung Internet?Opera Android?
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer10+
Firefox Android?Safari iOS?Chrome Android?WebView Android4.4.3+Samsung Internet?Opera Android12.1+option
and script-supporting elements.[
datalist
element represents a set of option
elements that
represent predefined options for other controls. In the rendering, the datalist
element represents nothing and it, along with its children, should
be hidden.datalist
element can be used in two ways. In the simplest case, the
datalist
element has just option
element children.datalist
element can be given contents that are to
be displayed for down-level clients that don't support datalist
. In this case, the
option
elements are provided inside a select
element inside the
datalist
element.datalist
element is hooked up to an input
element using the list
attribute on the input
element.option
element that is a descendant of the datalist
element,
that is not disabled, and whose value is a string that isn't the empty string, represents a
suggestion. Each suggestion has a value and a label.
options
IDL attribute must return an
datalist
node, whose filter matches
option
elements.datalist
element
ancestor, it is barred from constraint validation.4.10.9 The
optgroup
element
Opera?Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+select
element.option
and script-supporting elements.optgroup
element's end tag can be omitted
if the optgroup
element is
immediately followed by another optgroup
element, if it is immediately followed by an
hr
element, or if there is no more content in the parent
element.disabled
— Whether the form control is disabledlabel
— User-visible label[
optgroup
element represents a group of option
elements with a common label.option
elements consists of the option
elements that are children of the optgroup
element.option
elements in select
elements, user agents should
show the option
elements of such groups as being related to each other and separate
from other option
elements.
Opera?Edge79+
Edge (Legacy)12+Internet Explorer8+
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?disabled
attribute is a boolean
attribute and can be used to disable a group
of option
elements together.label
attribute must be specified. Its value gives the name of the group, for the purposes of the user
interface. User agents should use this attribute's value when labeling the group of
option
elements in a select
element.disabled
and label
attributes must
reflect the respective content attributes of the same name.optgroup
element. Only
option
elements can be selected. An optgroup
element merely provides a
label for a group of option
elements.select
drop-down widget:4.10.10 The
option
element
Opera?Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+select
element.datalist
element.optgroup
element.label
attribute and a value
attribute: Nothing.label
attribute but no value
attribute: Text.label
attribute and is not a
child of a datalist
element: Text that is not
inter-element whitespace.label
attribute and is a child
of a datalist
element: Text.option
element's end tag can be omitted if
the option
element is immediately followed by another option
element, if
it is immediately followed by an optgroup
element, if it is immediately followed by
an hr
element, or if there is no more content in the parent element.disabled
— Whether the form control is disabledlabel
— User-visible labelselected
— Whether the option is selected by defaultvalue
— Value to be used for form submission[
option
element represents an option in a select
element or as part of a list of suggestions in a datalist
element.select
element, an
option
element can be a select
element's placeholder label
option. A placeholder label option does not represent an actual option, but
instead represents a label for the select
control.
Opera?Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?disabled
attribute is a boolean attribute. An option
element is disabled if its disabled
attribute is present or if it is a child of an
optgroup
element whose disabled
attribute is present.option
element that is disabled must
prevent any click
events that are queued on the user interaction task source from being dispatched on the
element.label
attribute provides a label for element. The label of an
option
element is the value of the label
content attribute, if there is one and its value is not the empty string, or, otherwise, the value
of the element's text
IDL attribute.label
content attribute, if specified, must not be
empty.value
attribute provides a value for element. The value of an
option
element is the value of the value
content attribute, if there is one, or, if there is not, the value of the element's text
IDL attribute.selected
attribute is a boolean attribute. It represents the default selectedness of the element.option
element is
a boolean state, initially false. It controls whether adding or removing the selected
content attribute has any effect.option
element is a boolean state, initially false. Except where otherwise specified, when the element is
created, its selectedness must be set to true if
the element has a selected
attribute. Whenever an
option
element's selected
attribute is
added, if its dirtiness is false, its selectedness must be set to true. Whenever an
option
element's selected
attribute is
removed, if its dirtiness is false, its
selectedness must be set to false.Option()
constructor, when called with three
or fewer arguments, overrides the initial state of the selectedness state to always be false even if the third
argument is true (implying that a selected
attribute is
to be set). The fourth argument can be used to explicitly set the initial selectedness state when using the constructor.select
element whose multiple
attribute is not specified must not have more than one descendant option
element with
its selected
attribute set.option
element's index is the number of
option
elements that are in the same list of
options but that come before it in tree order. If the option
element is not in a list of options, then the
option
element's index is zero.option.selected
option.index
select
element's options
list.option.form
form
element, if any, or null otherwise.option.text
script
elements are skipped.option = new Option([ text [, value [, defaultSelected [, selected ] ] ] ])
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+option
element.value
attribute.selected
attribute.disabled
IDL attribute must reflect the
content attribute of the same name. The defaultSelected
IDL attribute must
reflect the selected
content
attribute.label
IDL attribute, on getting, if there is a label
content
attribute, must return that attribute's value; otherwise, it must return the element's label. On setting, the element's label
content attribute must be set to the new value.value
IDL attribute, on getting, must return the element's value. On setting, the element's value
content attribute must be set to the new value.selected
IDL attribute, on getting, must return true if
the element's selectedness is true, and false
otherwise. On setting, it must set the element's selectedness to the new value, set its dirtiness to true, and then cause the element to
ask for a reset.index
IDL attribute must return the element's index.text
IDL
attribute, on getting, must return the result of stripping and collapsing ASCII whitespace from the concatenation of data of all the option
element, in tree order, excluding any that are descendants of
descendants of the option
element that are themselves script
or
SVG script
elements.text
attribute's setter must string replace
all with the given value within this element.form
IDL
attribute's behavior depends on whether the option
element is in a
select
element or not. If the option
has a select
element
as its parent, or has an optgroup
element as its parent and that
optgroup
element has a select
element as its parent, then the form
IDL attribute must return the same value as the form
IDL attribute on that select
element. Otherwise, it
must return null.HTMLOptionElement
objects (in
addition to the factory methods from DOM such as ):
Option(text, value,
defaultSelected, selected)
. When invoked, the legacy factory
function must perform the following steps:Document
.option
, and the HTML
namespace.text.
value
" and value.selected
" and the empty string.4.10.11 The
textarea
element
Opera12.1+Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS3+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+
Opera8+Edge79+
Edge (Legacy)12+Internet Explorer5+
Firefox Android?Safari iOS?Chrome Android?WebView Android37+Samsung Internet?Opera Android10.1+autocomplete
— Hint for form autofill featurecols
— Maximum number of characters per linedirname
— Name of form control to use for sending the element's directionality in form submissiondisabled
— Whether the form control is disabledform
— Associates the element with a form
elementmaxlength
— Maximum length of valueminlength
— Minimum length of valuename
— Name of the element to use for form submission and in the form.elements
API placeholder
— User-visible label to be placed within the form controlreadonly
— Whether to allow the value to be edited by the userrequired
— Whether the control is required for form submissionrows
— Number of lines to showwrap
— How the value of the form control is to be wrapped for form submission[
textarea
element represents a multiline plain text edit
control for the element's raw
value. The contents of the control represent the control's default value.textarea
control must be initially the empty string.readonly
attribute is a boolean
attribute used to control whether the text can be edited by the user or not.Filename:
readonly
attribute is specified on a textarea
element, the element is barred from constraint validation.textarea
element is mutable if it is
neither disabled nor has a readonly
attribute specified.textarea
is mutable, its raw value should be editable by the user: the user
agent should allow the user to edit, insert, and remove text, and to insert and remove line breaks
in the form of U+000A LINE FEED (LF) characters. Any time the user causes the element's raw value to change, the user agent must queue an
element task on the user interaction task source given the
textarea
element to fire an event named
input
at the textarea
element, with the
textarea
element's dirty value flag must
be set to true whenever the user interacts with the control in a way that changes the raw value.textarea
elements must propagate the raw value and dirty value flag from the node being cloned to the copy.textarea
elements must, if the
element's dirty value flag is false, set the element's
raw value to its child text
content.textarea
elements is to set the user interacted to false, dirty value flag back to false, and set the raw value of element to its child text
content.textarea
element is popped off the stack of open elements of
an HTML parser or XML parser, then the user agent must invoke the
element's reset algorithm.dir
attribute to "ltr
" if the user selected a left-to-right writing direction, and
"rtl
" if the user selected a right-to-left writing
direction.textarea
element to fire an event named
input
at the textarea
element, with the
cols
attribute specifies the expected maximum number of characters per line. If the cols
attribute is specified, its value must be a valid
non-negative integer greater than zero. If applying the rules for
parsing non-negative integers to the attribute's value results in a number greater than
zero, then the element's character width is that
value; otherwise, it is 20.textarea
element's character width as a hint to the user as to how many
characters the server prefers per line (e.g. for visual user agents by making the width of the
control be that many characters). In visual renderings, the user agent should wrap the user's
input in the rendering so that each line is no wider than this number of characters.rows
attribute specifies the number of lines to show. If the rows
attribute is specified, its value must be a valid
non-negative integer greater than zero. If applying the rules for
parsing non-negative integers to the attribute's value results in a number greater than
zero, then the element's character height is that
value; otherwise, it is 2.wrap
attribute is an enumerated attribute with two keywords and states: the soft
keyword
which maps to the Soft state, and the hard
keyword
which maps to the Hard state. The missing value default and invalid value default are the Soft state.textarea
is not to be wrapped when it is submitted (though it can still be wrapped in
the rendering).textarea
is to have newlines added by the user agent so that the text is wrapped when
it is submitted.wrap
attribute is in the Hard state, the cols
attribute must be specified.value
IDL
attribute, textLength
IDL attribute, and by the
maxlength
and minlength
content attributes. It is normalized so that line
breaks use U+000A LINE FEED (LF) characters. Finally, there is the value, as used in form submission and other processing models in
this specification. It is normalized as for the API
value, and in addition, if necessary given the element's wrap
attribute, additional line breaks are inserted to wrap the
text at the given width.wrap
attribute is in the Hard state, insert U+000A LINE FEED (LF) characters
into the string using an implementation-defined algorithm so that each line has no
more than character width characters. For the
purposes of this requirement, lines are delimited by the start of the string, the end of the
string, and U+000A LINE FEED (LF) characters.maxlength
attribute is a form control maxlength
attribute.textarea
element has a maximum allowed value length, then the
element's children must be such that the length of the value of the element's
descendant text content with newlines
normalized is equal to or less than the element's maximum allowed value
length.minlength
attribute is a form control minlength
attribute.required
attribute is a boolean
attribute. When specified, the user will be required to enter a value before submitting the
form.required
attribute specified, and the element is mutable, and the element's value is the empty string, then the element is suffering
from being missing.placeholder
attribute represents a short
hint (a word or short phrase) intended to aid the user with data entry when the control has no
value. A hint could be a sample value or a brief description of the expected format.placeholder
attribute should not be used as
an alternative to a label
. For a longer hint or other advisory text, the title
attribute is more appropriate.label
is shown at all times; the short hint given in the placeholder
attribute is shown before the user enters a
value; and the hint in the title
attribute is shown when the user
requests further help.autofocus
attribute, since
in that case the user will not have had an opportunity to examine the control before focusing
it.name
attribute represents the element's name.
The dirname
attribute controls how the element's directionality is submitted.
The disabled
attribute is used to make the control
non-interactive and to prevent its value from being submitted.
The form
attribute is used to explicitly associate the
textarea
element with its form owner.
The autocomplete
attribute controls how the user agent
provides autofill behavior.
textarea.type
textarea
".textarea.value
cols
, placeholder
, required
, rows
, and wrap
IDL
attributes must reflect the respective content attributes of the same name. The cols
and rows
attributes
are limited to only positive numbers with fallback. The cols
IDL attribute's default value is 20. The rows
IDL attribute's default value is 2. The dirName
IDL
attribute must reflect the dirname
content
attribute. The maxLength
IDL attribute must reflect the
maxlength
content attribute, limited to only
non-negative numbers. The minLength
IDL attribute must reflect the
minlength
content attribute, limited to only
non-negative numbers. The readOnly
IDL attribute must reflect the
readonly
content attribute.type
IDL attribute must return the value "textarea
".defaultValue
attribute's getter must return the
element's child text content.
defaultValue
attribute's setter must
string replace all with the given value within this element.value
IDL attribute must, on getting, return the
element's API value. On setting, it must perform the
following steps:none
".textLength
IDL attribute must return the
length of the element's API value.willValidate
, validity
, and validationMessage
IDL attributes, and the checkValidity()
, reportValidity()
, and setCustomValidity()
methods, are part of the
constraint validation API. The labels
IDL
attribute provides a list of the element's label
s. The select()
, selectionStart
, selectionEnd
, selectionDirection
, setRangeText()
, and setSelectionRange()
methods and IDL attributes
expose the element's text selection. The disabled
,
form
, and name
IDL attributes
are part of the element's forms API.textarea
being used for unrestricted free-form text input
in a form:maxlength
attribute:dirname
attribute can be specified:4.10.12 The
output
element
Opera11+Edge79+
Edge (Legacy)18Internet ExplorerNo
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android11+
Opera12.1+Edge79+
Edge (Legacy)14+Internet ExplorerNo
Firefox Android?Safari iOS?Chrome Android?WebView Android3+Samsung Internet?Opera Android12.1+for
— Specifies controls from which the output was calculatedform
— Associates the element with a form
elementname
— Name of the element to use in the form.elements
API. [
output
element represents the result of a calculation performed
by the application, or the result of a user action.samp
element, which is the
appropriate element for quoting the output of other programs run previously.
Opera11+Edge79+
Edge (Legacy)18Internet ExplorerNo
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android11+for
content
attribute allows an explicit relationship to be made between the result of a calculation and the
elements that represent the values that went into the calculation or that otherwise influenced the
calculation. The for
attribute, if specified, must contain a
string consisting of an unordered set of unique space-separated tokens, none of which
are identical to another token and each of which must have the value of an ID of an element in the same tree.form
attribute is used to explicitly associate the
output
element with its form owner. The name
attribute represents the element's name. The output
element is associated with a form so that it can be easily referenced from the event
handlers of form controls; the element's value itself is not submitted when the form is
submitted.output
elements is to run these steps:
output.value [ = value ]
output.defaultValue [ = value ]
output.type
output
".value
getter steps are to return this's descendant text content.value
setter steps are:defaultValue
getter steps are to return the result
of running this's default
value.defaultValue
setter steps are:type
getter steps are to return "output
".htmlFor
IDL attribute must reflect the for
content attribute.willValidate
, validity
, and validationMessage
IDL attributes, and the checkValidity()
, reportValidity()
, and setCustomValidity()
methods, are part of the
constraint validation API. The labels
IDL
attribute provides a list of the element's label
s. The form
and name
IDL attributes are
part of the element's forms API.output
for its display of calculated results:output
element is used to report the results of a calculation performed by a remote
server, as they come in:4.10.13 The
progress
element
Opera11+Edge79+
Edge (Legacy)12+Internet Explorer10+
Firefox Android?Safari iOS7+Chrome Android?WebView Android?Samsung Internet?Opera Android11+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer10+
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+progress
element descendants.value
— Current value of the elementmax
— Upper bound of range[
progress
element represents the completion progress of a task.
The progress is either indeterminate, indicating that progress is being made but that it is not
clear how much more work remains to be done before the task is complete (e.g. because the task is
waiting for a remote host to respond), or the progress is a number in the range zero to a maximum,
giving the fraction of work that has so far been completed.
Opera11+Edge79+
Edge (Legacy)12+Internet Explorer10+
Firefox Android?Safari iOS7+Chrome Android?WebView Android?Samsung Internet?Opera Android11+value
attribute specifies how much of the task has been completed, and the max
attribute specifies how much work
the task requires in total. The units are arbitrary and not specified.value
attribute with the current progress (either a number from
0.0 to 1.0, or, if the max
attribute is specified, a number
from 0 to the value of the max
attribute). To make an
indeterminate progress bar, remove the value
attribute.updateProgress()
method in this example would be called by some
other code on the page to update the actual progress bar as the task progressed.)value
and max
attributes, when present, must have values that are valid floating-point numbers. The value
attribute, if present, must have a value equal to or
greater than zero, and less than or equal to the value of the max
attribute, if present, or 1.0, otherwise. The max
attribute, if present, must have a value greater than
zero.progress
element is the wrong element to use for something that
is just a gauge, as opposed to task progress. For instance, indicating disk space usage using
progress
would be inappropriate. Instead, the meter
element is available
for such use cases.value
attribute is omitted, then the progress bar is an indeterminate progress bar. Otherwise, it is a
determinate progress bar.max
attribute, the user agent must parse the max
attribute's value according to the rules for parsing
floating-point number values. If this does not result in an error, and if the parsed value
is greater than zero, then the maximum value of the
progress bar is that value. Otherwise, if the element has no max
attribute, or if it has one but parsing it resulted in an
error, or if the parsed value was less than or equal to zero, then the maximum value of the progress bar is 1.0.value
attribute's value according to the rules for
parsing floating-point number values. If this does not result in an error and the parsed
value is greater than zero, then the value of the
progress bar is that parsed value. Otherwise, if parsing the value
attribute's value resulted in an error or a number less
than or equal to zero, then the value of the progress
bar is zero.progress
element to the user, the UA should indicate whether it is a determinate or
indeterminate progress bar, and in the former case, should indicate the relative position of the
current value relative to the maximum value.progress.position
position
IDL attribute
must return −1. Otherwise, it must return the result of dividing the current value by the maximum value.value
IDL attribute, on
getting, must return 0. Otherwise, it must return the current value. On setting, the given value must be
converted to the best representation of the number as a floating-point number and
then the value
content attribute must be set to that
string.value
IDL attribute to itself
when the corresponding content attribute is absent would change the progress bar from an
indeterminate progress bar to a determinate progress bar with no progress.max
IDL attribute must reflect the content attribute of the same name, limited to
only positive numbers. The default value for max
is 1.0.labels
IDL attribute provides a list of the element's
label
s.4.10.14 The
meter
element
Opera11+Edge79+
Edge (Legacy)18Internet ExplorerNo
Firefox Android?Safari iOS10.3+Chrome Android?WebView AndroidNoSamsung Internet?Opera Android11+
Opera11+Edge79+
Edge (Legacy)12+Internet ExplorerNo
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android11+meter
element descendants.value
— Current value of the elementmin
— Lower bound of rangemax
— Upper bound of rangelow
— High limit of low rangehigh
— Low limit of high rangeoptimum
— Optimum value in gauge[
meter
element represents a scalar measurement within a known
range, or a fractional value; for example disk usage, the relevance of a query result, or the
fraction of a voting population to have selected a particular candidate.meter
element should not be used to indicate progress (as in a progress bar).
For that role, HTML provides a separate progress
element.meter
element also does not represent a scalar value of arbitrary
range — for example, it would be wrong to use this to report a weight, or height, unless
there is a known maximum value.
Opera11+Edge79+
Edge (Legacy)18Internet ExplorerNo
Firefox Android?Safari iOS10.3+Chrome Android?WebView AndroidNoSamsung Internet?Opera Android11+
Opera11+Edge79+
Edge (Legacy)18Internet ExplorerNo
Firefox Android?Safari iOS10.3+Chrome Android?WebView AndroidNoSamsung Internet?Opera Android11+min
attribute
specifies the lower bound of the range, and the max
attribute specifies the upper bound. The value
attribute specifies
the value to have the gauge indicate as the "measured" value.low
attribute specifies the range that is
considered to be the "low" part, and the high
attribute specifies the range that is considered to be
the "high" part. The optimum
attribute gives the position that is "optimum";
if that is higher than the "high" value then this indicates that the higher the value, the better;
if it's lower than the "low" mark then it indicates that lower values are better, and naturally if
it is in between then it indicates that neither high nor low values are good.value
attribute must be specified. The value
, min
, low
, high
, max
, and optimum
attributes,
when present, must have values that are valid
floating-point numbers.value
attribute's
number.min
attribute is specified, then let minimum be that attribute's value; otherwise, let it be zero.max
attribute is specified, then let maximum be that attribute's value; otherwise, let it be 1.0.low
≤ maximum (if low
is specified)high
≤ maximum (if high
is specified)optimum
≤ maximum (if optimum
is specified)low
≤ high
(if
both low
and high
are
specified)meter
element.meter
element's value
attribute provides the element's machine-readable value.Storage space usage:
Voter turnout:
Tickets sold:
meter
element, but the units may
be specified in the title
attribute in free-form text.min
, max
, value
, low
, high
, and optimum
attributes using the rules for parsing floating-point number values.min
attribute is specified and a value could be
parsed out of it, then the minimum value is that value. Otherwise, the minimum value is
zero.max
attribute is specified and a value could be
parsed out of it, then the candidate maximum value is that value. Otherwise, the candidate
maximum value is 1.0.value
attribute is specified and a value could
be parsed out of it, then that value is the candidate actual value. Otherwise, the candidate
actual value is zero.low
attribute is specified and a value could be
parsed out of it, then the candidate low boundary is that value. Otherwise, the candidate low
boundary is the same as the minimum value.high
attribute is specified and a value could be
parsed out of it, then the candidate high boundary is that value. Otherwise, the candidate high
boundary is the same as the maximum value.optimum
attribute is specified and a value
could be parsed out of it, then the candidate optimum point is that value. Otherwise, the
candidate optimum point is the midpoint between the minimum value and the maximum value.meter
element to the user, the UA should indicate the relative position of the actual value to the
minimum and maximum values, and the relationship between the actual value and the three regions of
the gauge.title
attribute and the other attributes to provide context-sensitive
help or inline text detailing the actual values.value
IDL
attribute, on getting, must return the actual value. On
setting, the given value must be converted to the best representation of the number as a
floating-point number and then the value
content
attribute must be set to that string.min
IDL
attribute, on getting, must return the minimum value.
On setting, the given value must be converted to the best representation of the number as a
floating-point number and then the min
content
attribute must be set to that string.max
IDL
attribute, on getting, must return the maximum value.
On setting, the given value must be converted to the best representation of the number as a
floating-point number and then the max
content
attribute must be set to that string.low
IDL
attribute, on getting, must return the low boundary. On
setting, the given value must be converted to the best representation of the number as a
floating-point number and then the low
content
attribute must be set to that string.high
IDL
attribute, on getting, must return the high boundary. On
setting, the given value must be converted to the best representation of the number as a
floating-point number and then the high
content
attribute must be set to that string.optimum
IDL attribute, on getting, must return the optimum
value. On setting, the given value must be converted to the best representation of
the number as a floating-point number and then the optimum
content attribute must be set to that string.labels
IDL attribute provides a list of the element's
label
s.4.10.15 The
fieldset
element
Opera15+Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android14+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+legend
element, followed by flow content.disabled
— Whether the descendant form controls, except any inside legend
, are disabledform
— Associates the element with a form
elementname
— Name of the element to use in the form.elements
API. [
fieldset
element represents a set of form controls (or other
content) grouped together, optionally with a caption. The caption is given by the first
legend
element that is a child of the fieldset
element, if any. The
remainder of the descendants form the group.
Opera12+Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android12+disabled
attribute, when specified, causes all the
form control descendants of the fieldset
element, excluding those that are
descendants of the fieldset
element's first legend
element child, if
any, to be disabled.fieldset
element is a disabled
fieldset if it matches any of the following conditions:disabled
attribute is specified
fieldset
element whose disabled
attribute is specified, and is not a
descendant of that fieldset
element's first legend
element child, if
any.form
attribute is used to explicitly associate the
fieldset
element with its form owner. The name
attribute represents the element's name.fieldset.type
fieldset.elements
disabled
IDL attribute must reflect the
content attribute of the same name.type
IDL attribute must return the string "fieldset
".elements
IDL attribute must return an
fieldset
element, whose filter matches
listed elements.willValidate
, validity
, and validationMessage
attributes, and the checkValidity()
, reportValidity()
, and setCustomValidity()
methods, are part of the
constraint validation API. The form
and name
IDL attributes are part of the element's forms API.fieldset
element being used to group a set of related
controls:fieldset
elements. Here is an example expanding on the previous
one that does so:fieldset
, including the two radio buttons in the legends of the two nested
fieldset
s, will be disabled. However, if the checkbox is checked, then the radio
buttons will both be enabled and will let you select which of the two inner
fieldset
s is to be enabled.legend
element both labels
the grouping, and the nested heading element surfaces the grouping in the document outline:4.10.16 The
legend
element
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer6+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer6+
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+fieldset
element.[
legend
element represents a caption for the rest of the contents
of the legend
element's parent fieldset
element, if
any.form
IDL
attribute's behavior depends on whether the legend
element is in a
fieldset
element or not. If the legend
has a fieldset
element as its parent, then the form
IDL attribute must
return the same value as the form
IDL attribute on that
fieldset
element. Otherwise, it must return null.