Attributo del modulo HTML <output>

❮ Tag HTML <output>

Esempio

Un elemento <output> situato all'esterno di un form (ma fa ancora parte del form):

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

Definizione e utilizzo

L' formattributo specifica la forma a cui <output>appartiene il tag.

Il valore formdell'attributo deve essere uguale idall'attributo di un <form> elemento nello stesso documento.


Supporto del browser

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

Sintassi

<output form="form_id">

Valori di attributo

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.

❮ Tag HTML <output>