HTML <output> สำหรับแอตทริบิวต์
ตัวอย่าง
ทำการคำนวณและแสดงผลใน <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>
ความหมายและการใช้งาน
แอตทริบิวต์for
ระบุความสัมพันธ์ระหว่างผลลัพธ์ของการคำนวณและองค์ประกอบที่ใช้ในการคำนวณ
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนแอตทริบิวต์อย่างเต็มที่
Attribute | |||||
---|---|---|---|---|---|
for | 10.0 | 13.0 | 4.0 | 7.0 | 11.5 |
ไวยากรณ์
<output for="element_id">
ค่าแอตทริบิวต์
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 |
❮ แท็ก <output> HTML