HTML <output> form eigenschap

Definitie en gebruik

form het eigenschap bepaalt het formulier waarin het <output>-etiket behoort.

form de waarde van het eigenschap moet gelijk zijn aan die in hetzelfde document van <form> het id-eigenschap van het element.

Voorbeeld

Het <output> element buiten de formulier (maar nog steeds onderdeel van het formulier):

<form action="/action_page.php" id="numform"}
oninput="x.value=parseInt(a.value)+parseInt(b.value)"
<input type="range" id="a" name="a" value="50">
+ <input type="number" id="b" name="b" value="25">
<input type="submit">
</form>
<output form="numform" id="x" name="x" for="a+b"></output>

Try it yourself

Syntax

<output form="form_id">

Attribute value

Value Description
form_id

Specifies the form element to which the <output> element belongs.

The value of this attribute must be the id attribute of the <form> element in the same document.

Browser support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Not supported Not supported Not supported Not supported Not supported