English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML output for Attribut

Das Attribut 'for' spezifiziert das Verhältnis zwischen dem Ergebnis der Berechnung und dem Element, das in der Berechnung verwendet wird.

 HTML <output> Tag

Online-Beispiel

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

<!DOCTYPE html>
<html>
<head>
<title>HTML:<output> für Attribute - 基础教程网(oldtoolbag.com)</title>
</head>
<body>
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)>0
<input type="range" id="a" value="10">100
+<input type="number" id="b" value="10">
<input type="number" id="b" value="/output>
</form>
</body>
</html>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Firefox, Opera, Chrome, and Safari browsers all support the for attribute.

Note:The <output> tag is not supported by the Internet Explorer browser.

Definition and Usage

The for attribute specifies the relationship between the element used in the calculation and the calculated result.

HTML 4.01 with HTML5differences

The <output> tag is an HTML5 of the new tags.

Syntax

<output for="element_id">

Attribute Value

ValueDescription
element_idSpecify a space-separated list of one or more element IDs, which specifies the relationship between the calculated result and the elements used in the calculation.
 HTML <output> Tag