The for attribute on an <output> tag associates the output to an input element.
The value of this attribute is the id
of the input element.
An <output> element with a for attribute. The output is associated with the slider input. Move the slider to see the output change.
<form oninput="result.value = slider.value">
<input type="range" id="slider" value="25">
<br /><br />
The value is <output name="result" for="slider">25</output>
</form>
The for attribute on an output element associates the element with an input element.
The value of the for attribute is the id of the input element.
Multiple space-separated id values can be specified, one for each input element that contributes in the calculation.
<output for="element-ids">
Value | Description |
---|---|
element-ids |
Space-separated list of element ids used in the output's calculation. |
Here is when for support started for each browser:
Chrome
|
10.0 | Mar 2011 |
Firefox
|
4.0 | Mar 2011 |
IE/Edge
|
13.0 | Nov 2015 |
Opera
|
11.5 | May 2011 |
Safari
|
7.0 | Oct 2013 |
Back to <output>