Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

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.

Example

#

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">
 <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>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides