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 is not included in form submission.



An <output> element with a form attribute. 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">
  <legend>Pipe Pressure</legend>
  <input type="range" id="slider" name="pressure" 
         value="25"><br /><br />

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

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

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.


<output form="form-id">



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

Browser support

Here is when form support started for each browser:

Not Supported
Not Supported
Not Supported
Not Supported
Not Supported

You may also like

 Back to <output>

Last updated on Sep 30, 2023