HTML-<output > -Formularattribut

❮ HTML <output>-Tag

Beispiel

Ein <output>-Element, das sich außerhalb eines Formulars befindet (aber immer noch Teil des Formulars):

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

Definition und Verwendung

Das formAttribut gibt das Formular an, zu dem das <output>Tag gehört.

Der Wert des formAttributs muss gleich dem idAttribut eines <form> Elements im selben Dokument sein.


Browser-Unterstützung

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

Syntax

<output form="form_id">

Attributwerte

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