Atributo de formulario de <salida> HTML

❮ Etiqueta HTML <salida>

Ejemplo

Un elemento <output> ubicado fuera de un formulario (pero que sigue siendo parte del formulario):

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

Definición y uso

El formatributo especifica el formulario al <output>que pertenece la etiqueta.

El valor del formatributo debe ser igual al idatributo de un <form> elemento en el mismo documento.


Compatibilidad con navegador

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

Sintaxis

<output form="form_id">

Valores de atributo

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.

❮ Etiqueta HTML <salida>