HTML <output> per Attributo
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
L' for
attributo specifica la relazione tra il risultato del calcolo e gli elementi utilizzati nel calcolo.
Supporto del browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente l'attributo.
Attribute | |||||
---|---|---|---|---|---|
for | 10.0 | 13.0 | 4.0 | 7.0 | 11.5 |
Sintassi
<output for="element_id">
Valori di attributo
Value | Description |
---|---|
element_id | Specifies a space separated list of ids of one or more elements that specifies the relationship between the result of the calculation, and the elements used in the calculation |
❮ Tag HTML <output>