HTML <เอาต์พุต> ชื่อแอตทริบิวต์
ตัวอย่าง
ทำการคำนวณและแสดงผลใน <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>
ความหมายและการใช้งาน
แอตทริบิวต์name
ระบุชื่อของ
<output>
องค์ประกอบ
แอตทริบิวต์name
นี้ใช้เพื่ออ้างอิงข้อมูลในแบบฟอร์มหลังจากส่งแล้ว หรือเพื่ออ้างอิงองค์ประกอบใน JavaScript
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนแอตทริบิวต์อย่างเต็มที่
Attribute | |||||
---|---|---|---|---|---|
name | 10.0 | 13.0 | 4.0 | 7.0 | 11.5 |
ไวยากรณ์
<output name="name">
ค่าแอตทริบิวต์
Value | Description |
---|---|
name | Specifies the name of the <output> element |
❮ แท็ก <output> HTML