HTML <เอาต์พุต> แอตทริบิวต์รูปแบบ
ตัวอย่าง
<output> องค์ประกอบที่อยู่นอกแบบฟอร์ม (แต่ยังคงเป็นส่วนหนึ่งของแบบฟอร์ม):
<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>
ความหมายและการใช้งาน
แอตทริบิวต์form
ระบุรูปแบบที่
<output>
แท็กเป็นของ
ค่าของform
แอตทริบิวต์จะต้องเท่ากับ
id
แอตทริบิวต์ของ<form>
องค์ประกอบในเอกสารเดียวกัน
รองรับเบราว์เซอร์
Attribute | |||||
---|---|---|---|---|---|
form | Not supported | Not supported | Not supported | Not supported | Not supported |
ไวยากรณ์
<output form="form_id">
ค่าแอตทริบิวต์
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. |
❮ แท็ก <output> HTML