HTML <output> Tag

Definition und Verwendung

<output> Der Tag wird verwendet, um das Ergebnis einer Berechnung anzuzeigen (z.B. durch Skript ausgeführte Berechnung).

Weitere Informationen siehe:

HTML DOM Referenzhandbuch:Output-Objekt

Beispiel

Führen Sie den Berechnung aus und <output> Zeigen Sie das Ergebnis im Element an:

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

Versuchen Sie es selbst

Attribute

Attribute Value Description
for Element id Specifies the relationship between the calculated result and the elements used in the calculation.
form Form id Specifies the form to which the output element belongs.
name Name Specifies the name of the output element.

Global Attributes

<output> The tag also supports Global Attributes in HTML.

Event Attributes

<output> The tag also supports Event Attributes in HTML.

Default CSS Settings

Most browsers will display the following default values <output> Element:

output {
  display: inline;
}

Browser Support

The numbers in the table indicate the first browser version to fully support this tag.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
10.0 13.0 4.0 5.1 11.0