Tag HTML <output>
Esempio
Esegui un calcolo e mostra il risultato in un elemento <output>:
<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"></output>
</form>
Definizione e utilizzo
Il <output>
tag viene utilizzato per rappresentare il risultato di un calcolo (come quello eseguito da uno script).
Supporto browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente l'elemento.
Element | |||||
---|---|---|---|---|---|
<output> | 10.0 | 13.0 | 4.0 | 5.1 | 11.0 |
Attributi
Attribute | Value | Description |
---|---|---|
for | element_id | Specifies the relationship between the result of the calculation, and the elements used in the calculation |
form | form_id | Specifies which form the output element belongs to |
name | name | Specifies a name for the output element |
Attributi globali
Il <output>
tag supporta anche gli attributi globali in HTML .
Attributi dell'evento
Il <output>
tag supporta anche gli attributi dell'evento in HTML .
Pagine correlate
Riferimento HTML DOM: Oggetto di output
Impostazioni CSS predefinite
La maggior parte dei browser visualizzerà l' <output>
elemento con i seguenti valori predefiniti:
output {
display: inline;
}