HTML <output> formulier Attribuut

❮ HTML <output>-tag

Voorbeeld

Een <output>-element dat zich buiten een formulier bevindt (maar nog steeds deel uitmaakt 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>

Definitie en gebruik

Het formattribuut specificeert de vorm waartoe de <output>tag behoort.

De waarde van het formattribuut moet gelijk zijn aan het idattribuut van een <form> element in hetzelfde document.


Browserondersteuning

Attribute
form Not supported Not supported Not supported Not supported Not supported

Syntaxis

<output form="form_id">

Attribuutwaarden

Value Description
form_id Specifies the form element the <output> element belongs to. The value of this attribute must be the id attribute of a <form> element in the same document.

❮ HTML <output>-tag