Atribut formulir HTML <output>
Contoh
Elemen <output> yang terletak di luar formulir (tetapi masih merupakan bagian dari formulir):
<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>
Definisi dan Penggunaan
Atribut form
menentukan bentuk
<output>
tag milik.
Nilai form
atribut harus sama dengan
id
atribut <form>
elemen dalam dokumen yang sama.
Dukungan Peramban
Attribute | |||||
---|---|---|---|---|---|
form | Not supported | Not supported | Not supported | Not supported | Not supported |
Sintaksis
<output form="form_id">
Nilai Atribut
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. |
tag <keluaran> HTML