HTML <output> form Attribute

The form attribute on an <output> tag specifies the form the output element is associated with. Although linked to the form, the output value is not included in form submission.

Example

#

A form attribute on an <output> element. The output element is outside the form, but associated with it. Move the slider to see the output value update.

Pipe Pressure


The value is 25

<form action="/tutorial/action.html" id="pressure-form"
      oninput="result.value = slider.value">
 <fieldset>
  <legend>Pipe Pressure</legend>
  <input type="range" id="slider" name="pressure" 
         value="25"><br /><br />

  <input type="submit" value="Submit">
 </fieldset>
</form> <br />

<p>The value is 
   <output form="pressure-form" name="result" for="slider">25</output>
</p>

Note:  The output value is not submitted during form submission.


Using form

The form attribute specifies which form the output belongs to.

The attribute value is the id of the form.

The output value is not included during form submission.

Note: The form attribute on the output tag has been deprecated.


Syntax

<output form="form-id">

Values

#

Value Description
form-id The id value of the form.

Browser support

Here is when form support started for each browser:

Chrome
Not Supported
Firefox
Not Supported
IE/Edge
Not Supported
Opera
Not Supported
Safari
Not Supported

You may also like

 Back to <output>
Guides