Thuộc tính biểu mẫu HTML <input>
Thí dụ
Trường đầu vào nằm bên ngoài biểu mẫu HTML (nhưng vẫn là một phần của biểu mẫu):
<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">
Định nghĩa và Cách sử dụng
Thuộc form
tính chỉ định hình thức mà
<input>
phần tử thuộc về.
Hỗ trợ trình duyệt
Các số trong bảng chỉ định phiên bản trình duyệt đầu tiên hỗ trợ đầy đủ thuộc tính.
Attribute | |||||
---|---|---|---|---|---|
form | Yes | Yes | Yes | 5.1 | 10.6 |
Cú pháp
<input form="form_id">
Giá trị thuộc tính
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. |
❮ Thẻ HTML <input>