HTML <input> แอตทริบิวต์รูปแบบ
ตัวอย่าง
ช่องใส่ที่อยู่นอกแบบฟอร์ม HTML (แต่ยังคงเป็นส่วนหนึ่งของแบบฟอร์ม):
<form action="/action_page.php" id="form1">
<label for="fname">First name:</label>
<input type="text" id="fname"
name="fname"><br><br>
<input type="submit" value="Submit">
</form>
<label for="lname">Last name:</label>
<input type="text" id="lname"
name="lname" form="form1">
ความหมายและการใช้งาน
แอตทริบิวต์form
ระบุรูปแบบที่
<input>
เป็นขององค์ประกอบ
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนแอตทริบิวต์อย่างเต็มที่
Attribute | |||||
---|---|---|---|---|---|
form | Yes | Yes | Yes | 5.1 | 10.6 |
ไวยากรณ์
<input form="form_id">
ค่าแอตทริบิวต์
Value | Description |
---|---|
form_id | Specifies the form element the <input> element belongs to. The value of this attribute must be the id attribute of a <form> element in the same document. |
❮ แท็ก HTML <input>